Solved

Raw HTTP commands

Posted on 2009-07-01
12
294 Views
Last Modified: 2013-11-22
How do I send/receive data/file using HTTP commands without using any browser?!
0
Comment
Question by:krisrajz
12 Comments
 
LVL 5

Expert Comment

by:mnialon
ID: 24760869
hello
you can for example use a vbscript like that

  Set objSvrHTTP = CreateObject("Msxml2.XMLHTTP.4.0")
   objSvrHTTP.open "GET", "http://www.google.fr", false
   objSvrHTTP.send
  wscript.echo objSvrHTTP.responseText
0
 
LVL 5

Expert Comment

by:iUsername
ID: 24761340
You can use telnet or download netcat.

example for in telnet:
start -> run -> "cmd"
telnet // run telnet
set localecho // so you will be able to see what you're writing (as oppose to "real" telnet conenction.)
o www.google.com 80 // open a connection to www.google.com

Now, when you're connected to www.google.com you can write HTTP commands:
GET / HTTP/1.0[CRLF][CRLF] // [CRLF] == 1 click on ENTER

After 2 CRLFs you will get a response printed on the screen.
0
 
LVL 1

Author Comment

by:krisrajz
ID: 24761415
Similar to this whether PUT command is also available to send data to the server?!
0
 
LVL 5

Expert Comment

by:iUsername
ID: 24761842
PUT HTTP method should do something like that, but most servers disable this HTTP method (I believe you can understand why...).

by the way, you can use the HTTP OPTIONS method, it will return the implemented methods that the server supports, but even though a server might return PUT, it doesn't mean you are able to use PUT (sometimes authentication mechanism is being the request).
0
 
LVL 1

Author Comment

by:krisrajz
ID: 24775941
Whether POST command can be used?!
0
 
LVL 5

Expert Comment

by:iUsername
ID: 24776098
You can use the POST command, but it of course depends of the web server on the other side.

Using POST you can add "more data" and mark it's length in content-length, but if the website/server on the other side won't save the file you're sending, you'll just send it, while the other side will ignore it.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:krisrajz
ID: 24776134
Where can I get the list of HTTP commands with its syntax and if possible with examples?!
0
 
LVL 7

Expert Comment

by:Seo_Expert
ID: 24776158
Hello Krisrajz,

Below url will help you

http://usertools.plus.net/tutorials/id/21
0
 
LVL 1

Author Comment

by:krisrajz
ID: 24776278
I am trying out to send some data to the server using raw HTTP command POST ... a server side page awaiting for the data will receive and parse the data.
0
 
LVL 5

Accepted Solution

by:
iUsername earned 95 total points
ID: 24776679
So you need to forge your HTTP command according to the format the server expects.

For example, If there is a page called "http://bla.com/file_upload.php?filename=<filename>", you may need to send the file like this:

POST /file_upload.php?filename=<filename> HTTP/1.1
host: bla.com
content-length: <file size>

<file content>.....
0
 
LVL 1

Author Comment

by:krisrajz
ID: 24800743
Exactly yes!
0
 
LVL 1

Author Closing Comment

by:krisrajz
ID: 31599079
Ok
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Cloud file services can fill many different roles for your business. Often, the use of cloud file services begins with employees using consumer products, like Dropbox, to share files with customers and each other. While sync-and-share can be an effe…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now