Solved

Raw HTTP commands

Posted on 2009-07-01
12
299 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
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…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

726 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