?
Solved

Raw HTTP commands

Posted on 2009-07-01
12
Medium Priority
?
304 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
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
 
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 285 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Many of the companies I’ve worked with have embraced cloud solutions due to their desire to “get out of the datacenter business.” The ability to achieve better security and availability, and the speed with which they are able to deploy, is far grea…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
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.

765 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