Dumb question: is there a batch-mode utility (e.g. particular options for curl or wget) that can let me issue raw HTTP commands, and either output the raw results or pipe/redirect it as I see fit?
I know telnet theoretically works but I'm running Windows XP and both Microsoft telnet and PuTTY seem to be interactive and seem to screw things up.
edit: (clarification) I've used curl before, so am familiar w/ the idea, as well as how to send parameters via GET/POST, just not how to control the headers explicitly, and how to keep headers in the output... I can see two possible methods that would be useful to me:
Raw HTTP I/O -- I had meant literally like telnet but in batch mode (not opening up a new window or mucking with the terminal settings):
GET http://someserver/someresource/blah.html HTTP/1.1 301 Moved Permanently Date: Wed, 14 Oct 2009 21:23:40 GMT ...
"easy" input, raw HTTP output -- using curl in the normal methods, but being able to see the raw output verbatim:
> curl --some-option --another-option http://someserver/someresource/blah.html HTTP/1.1 301 Moved Permanently Date: Wed, 14 Oct 2009 21:23:40 GMT ...
Yes, both curl and wget can do this. Please give us more details on what kind of commands you want to execute.
Random example:
Sends some data via POST, as well as some arguments via GET to a specific URL. -q means don't give me progress updates, -O specifies what file to output to. Use
-O -
if you would like to pipe the results instead of saving to a file.Curl or wget are good options. But if you really want to have something equivalent to telnet you should probably use netcat (win32) instead of using telnet. Netcat is designed for raw i/o telnet isn't.
HTTP Client for Mac OS X is handy, http://ditchnet.org/httpclient/
For "easy" input, raw HTTP output :
curl -i --raw http://google.fr
For the other i guess that telnet is your best chance.
telnet
http://www.gnu.org/software/inetutils/
http://windows.microsoft.com/en-US/windows-vista/Telnet-frequently-asked-questions