Skip to content
OddsockLocal
Local
Source text

Formatting

1 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Enter the absolute URL.
  2. Pick the method. Add one header per line as Name: value.
  3. Put the raw body in the body field if the method has one.
  4. Copy the command. It is not executed.

What is cURL builder?

Curl builder writes a single curl command and does not run it. Method, headers and body are separate fields, so you are not hand-escaping a one-line shell command. A POST to https://example.test/api with Content-Type and Accept headers and the body {"name":"Sam"} comes out as curl --globoff -X 'POST' -H 'content-type: application/json' -H 'accept: application/json' --data-raw '{"name":"Sam"}' --url 'https://example.test/api'.

Read more

--globoff matters when the URL contains brackets. Curl would otherwise treat them as a glob. --data-raw sends the body exactly, without curl’s @file reading. An apostrophe in the body is escaped the shell way, so it's ok becomes 'it'\''s ok' inside the single quotes. That looks ugly and it is correct.

The URL must be absolute http or https with no embedded user or password. Header lines are Name: value, one per line, and a repeated name is an error. Snippet format stays on curl. Fetch, Axios and HTTPie have their own pages.

Use cases

  • A support macro needs a curl the customer can paste, with the JSON body already quoted.
  • An API doc writer would rather fill in method and headers than remember which curl flag sends a raw body.
  • A URL with square brackets has to keep those brackets, so --globoff has to be in the command.
  • The body contains an apostrophe and you want the shell quoting done for you.

POST JSON, ready to paste into a shell

URL https://example.test/api, method POST, headers Content-Type: application/json and Accept: application/json, body {"name":"Sam"}.

curl --globoff -X 'POST' -H 'content-type: application/json' -H 'accept: application/json' --data-raw '{"name":"Sam"}' --url 'https://example.test/api'

Why use Oddsock

--data-raw is deliberate. A body that starts with @ stays text, instead of becoming a filename curl would try to open.

Related tools

Using this tool

Curl treats brackets in a URL as a glob unless --globoff is set. API URLs sometimes contain them, so the flag is always included.