Link to home
Start Free TrialLog in
Avatar of krisrajz
krisrajz

asked on

Raw HTTP commands

How do I send/receive data/file using HTTP commands without using any browser?!
Avatar of mnialon
mnialon
Flag of France image

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
Avatar of iUsername
iUsername

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.
Avatar of krisrajz

ASKER

Similar to this whether PUT command is also available to send data to the server?!
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).
Whether POST command can be used?!
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.
Where can I get the list of HTTP commands with its syntax and if possible with examples?!
Hello Krisrajz,

Below url will help you

http://usertools.plus.net/tutorials/id/21
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.
ASKER CERTIFIED SOLUTION
Avatar of iUsername
iUsername

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Exactly yes!
Ok