krisrajz
asked on
Raw HTTP commands
How do I send/receive data/file using HTTP commands without using any browser?!
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.
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.
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).
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).
ASKER
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.
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.
ASKER
Where can I get the list of HTTP commands with its syntax and if possible with examples?!
ASKER
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Exactly yes!
ASKER
Ok
you can for example use a vbscript like that
Set objSvrHTTP = CreateObject("Msxml2.XMLHT
objSvrHTTP.open "GET", "http://www.google.fr", false
objSvrHTTP.send
wscript.echo objSvrHTTP.responseText