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
Solved

Raw HTTP commands

Posted on 2009-07-01
12
297 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

With the withdrawal of support for Windows Server 2003 this summer, many clients face the issue of moving away from their 2003 installs. There are a few options out there that many people/companies are selling. But the clients I have, haven't wanted…
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
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…
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.

860 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