Sending raw body with httpie in http-prompt

Viewed 2542

HTTPie fills the request's body with stdin, so it's easy to send raw text or JSON with echo '{...}' | http POST example.com like here: Sending nested JSON object using HTTPie.

http-prompt is a handy CLI interface for http and it allows setting body parameters like this:

> user=foo

or also in raw JSON:

> user:=foo

Which set the body to {"user": "foo"} upon sending.

But how can I send string {"user": "foo"} as the body directly?

  1. As a text like echo '{"user": "foo"}' | http POST http://example.com
  2. As a file like curl --data '@/path/to/file' http://example.com
2 Answers

As of May 17, 2018: This cannot be done with http-prompt. There is an open Github issue on this one.

Related