Imagine something like this:
$ curlsh http://www.example.org > GET /foo/bar/bam ...output here... > POST /thing/pool ... ... result here....
is there a tool that lets me do that?
On many Linux/Unix systems, your pseudocode will just work in any shell, although your paths should really be full URLs.
For instance, on Debian-based systems, the package
Of course you could also use
Directory listings only work for websites that do send directory indexes. But even if they don't you can still use the
Thanks for the answers.
After googling around, I found resty, which is a shell script wrapper around the curl tool. This is really what I want. It's 155 lines of shell script, and when I run it, I get functions for GET, PUT, POST, DELETE, and OPTIONS. These functions are just wrappers around the curl program found on my path.
It works like this on MacOSX bash:
The first line there just runs the commands in the current shell.
The next line, the "resty" command, sets the URL base. Thereafter, any call to GET, PUT, POST... implicitly references that base. I showed an example that emits prettified JSON. I think if your server emits minified JSON, you could pretty-print it with an external script by piping the output.
There's support for host-based preferences. Suppose your target host is api.example.org. Ceate a file called ~/.resty/api.example.org, and insert in there, lines which specify arguments that should be passed to every curl call to the host by that name. Each http verb gets its own line. So, inserting this content in the file:
...means that every time I do a GET when api.example.org is the base hostname, the curl command will implicitly use the
As another example, you could specify the Accept header in that file, so that you always request XML:
Any curl command line arg is supported in that preferences file. All the curl args for the host+verb tuple need to go on a single line in the preferences file.
You can use Netcat.
Here is an example to retrieve the VLC home page
The rest of the HTML is output to the console. Note: You need to
type Return twice after
You can use interactive
In Python :
I quite like lynx for interactive browsing on the command line. It's more of a full blown browser (that fits into an ncurses application) than a raw HTML tool, though..
I've tested raw HTML commands over SSL before, for which I used
For more info on openssl's s_client options,