Skip to content
OddsockLocal
Local
Source text

Formatting

1 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Enter the absolute URL and choose the method.
  2. Add headers as Name: value lines. They are written name:value.
  3. Leave the body empty for GET, or fill it in to get a printf pipe.
  4. Copy the command. HTTPie is not launched.

What is HTTPie command?

HTTPie’s syntax is easy to mistype once headers and a body show up, because headers look like key:value items and the body often arrives on stdin. This page writes the command for you. A GET https://example.test/api with Accept: application/json and no body becomes http --ignore-stdin -- 'GET' 'https://example.test/api' 'accept:application/json'.

Read more

--ignore-stdin is there because HTTPie will read a body from a pipe when it thinks you wanted one. On a GET, that surprise is a bug. When you do fill in a body, the command starts with printf '%s' and a shell-quoted payload, piped into http. The body is literal text, not a file path.

The request is not sent. URL rules match the other builders: absolute http or https, no embedded credentials. Header names are lowercased and written as name:value with no space, which is the form HTTPie expects. Snippet format stays on httpie.

Use cases

  • A runbook is written in HTTPie and the ticket only has the URL, the method and a header.
  • You want a GET that will not swallow whatever happens to be on stdin in a shared terminal.
  • The body has quotes and you want printf quoting rather than hoping the colon syntax still parses.
  • You are comparing HTTPie with the curl builder’s --data-raw form of the same call.

GET with one header and stdin ignored

URL https://example.test/api, method GET, header Accept: application/json, empty body.

http --ignore-stdin -- 'GET' 'https://example.test/api' 'accept:application/json'

Why use Oddsock

--ignore-stdin on a bodyless command is the detail that keeps a piped log from becoming the request body.

Related tools

Using this tool

HTTPie reads stdin when a body might be expected. On a GET with an empty body the flag stops a surrounding pipe from being uploaded.