Solved

Raw HTTP commands

Posted on 2009-07-01
12
295 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
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.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

863 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

27 Experts available now in Live!

Get 1:1 Help Now