Assuming you have a reasonably recent version of Rust/Cargo installed, simply run cargo install rural
.
Rural currently supports making GET and POST requests. To make a request, invoke rural with the request method (in lowercase) and the URL:
sh
rural get http://example.com
rural post http://example.com
Rural supports HTTPS requests if OpenSSL is installed:
sh
rural get https://example.com
To see the response headers returned, use the --headers
flag (-d
for short):
sh
rural --headers get http://example.com
rural -d get http://example.com
Rural supports supplying GET parameters in the querystring or by using the syntax key==value
:
sh
rural get 'http://example.com?bass=john&drums=keith'
rural get http://example.com bass==john drums==keith
To supply POST parameters, use the syntax key=value
:
sh
rural post http://example.com bass=john drums=keith
Rural defaults to sending POST parameters as JSON. To instead send them as form parameters, use --form
(-f
for short):
sh
rural --form post http://example.com bass=john drums=keith
rural -f post http://example.com bass=john drums=keith