RESH, the REst SHell
A basic command:
GET foo/bar -Accept=text/html
Rewritten:
GET foo/bar [text/html]
The brackets are a fat pipe. It sets the accept header when it's on the right side of a command.
GET foo/bar [text/html] POST foo/baz
This will pipe the response body of foo/bar into the request body of foo/baz. The fat pipe sets the content-type when it's on the left side.
foo/bar [html] foo/baz
^ Same command, but using default methods (GET if there's no body, POST if there is) and a shorthand mimetype.
So I want to add a way to set the request body in the command, which it doesnt have atm. I'm considering the --
, as in:
POST foo/baz --"The Request Body"
But quotes are optional:
POST foo/baz -- The request body
The same, but with a header (and defaulting to POST because of the request body):
foo/baz -Accept=text/html -- The request body
The same, but with the fat pipe:
foo/baz -- The request body [html]
So the left bracket ends the body. If you need left bracks, you quote:
foo/baz -- "The request [body!]" [html]
Work for yall?