curl Command Builder
Build a real, working curl command from an HTTP method, URL, headers, body, and auth options — with correct shell quoting applied automatically — and copy it in one click.
231 views
A Brief History of curl
curl was created in 1998 by Swedish developer Daniel Stenberg, who wrote its first version to automatically fetch currency exchange rates for an IRC bot in a Swedish chat channel — a small, personal itch, not a grand plan to build infrastructure. People kept asking for more protocols and more options, and the little utility grew into a general-purpose command-line tool for transferring data over HTTP, HTTPS, FTP, and eventually dozens of other protocols. Stenberg has remained curl's lead maintainer for essentially its entire life since; today curl ships by default on macOS, virtually every Linux distribution, and — since 2018 — Windows 10 and later, and it is estimated to run on billions of devices worldwide, from routers and cars to game consoles and nearly every continuous-integration pipeline that talks to an API. What began as a fix for one narrow personal problem is now arguably the single most widely deployed command-line HTTP client in existence, and one of the most quietly depended-upon pieces of open-source software on the internet.
Reading the Flags This Tool Generates
By default, curl does not follow HTTP redirects. If a server responds with a 301 or 302 status and a Location header pointing elsewhere, plain curl prints that redirect response — or an empty body — and stops; it does not automatically chase the new URL the way a web browser silently does. This trips up an enormous number of first-time curl users: a URL that works perfectly in a browser returns a confusing empty or wrong response from curl, for no apparent reason, simply because the browser followed a redirect curl didn't. The fix is the -L (--location) flag, which tells curl to follow the redirect chain to its final destination. It is such a common requirement that many engineers reach for -L by default any time they are not deliberately testing redirect behavior itself.
Once a command includes headers or body content containing spaces, quotes, or shell-special characters ($, &, ;, backticks), how you quote it stops being cosmetic — it is the difference between a request that works and one the shell mangles before curl ever sees it. A header like Authorization: Bearer abc 123 typed without quotes gets split by the shell at the space, so curl receives Authorization: and Bearer as two separate, broken arguments instead of one. Wrapping the whole value in single quotes tells the shell to treat everything inside literally, including spaces — but single quotes cannot contain a literal single-quote character themselves, since that character is what closes the quote. The standard escape for that case is to close the quote, insert a backslash-escaped single quote, and reopen the quote: '\''. This tool applies that escaping automatically to every value it inserts, so headers, body content, and auth credentials containing spaces, quotes, or other special characters always produce a command that runs correctly — without you needing to remember the escaping rules yourself.
Frequently Asked Questions
Why do I need the -L flag for some curl commands?
curl does not follow HTTP redirects by default. If the server you're calling responds with a 301 or 302 status and a Location header, plain curl shows you that redirect response instead of the final content and stops there. Browsers follow redirects silently, which is why a URL that "works in the browser" can return an empty or unexpected response from curl. Adding -L (--location) tells curl to follow the chain of redirects automatically until it reaches the final destination.
Why does my curl command fail when a header has a space in it?
The shell — not curl — is what splits a command line into separate arguments, and it splits on unquoted spaces by default. A header value like Bearer abc123 typed without quotes becomes two separate words the shell hands to curl as if they were two different arguments, breaking the header. Wrapping the value in single quotes tells the shell "treat everything inside as one literal piece, spaces included," which is exactly what this tool does automatically for every field you fill in.
What's the difference between JSON mode and Raw mode for the request body?
JSON mode automatically adds a Content-Type: application/json header alongside your body, telling the server to parse the payload as JSON — most modern APIs require this header to be present or they will reject or misinterpret the request. Raw mode sends exactly the text you typed with no assumed content type, which is the right choice for form-encoded data, plain text, XML, or any body where you want to set your own Content-Type header manually via the headers section.
Is Bearer token auth the same as Basic auth?
No, they work differently. Bearer auth sends an Authorization: Bearer <token> header carrying an opaque access token, typically issued by an OAuth flow or API key system — the server looks the token up rather than decoding it. Basic auth sends Authorization: Basic <base64(username:password)>, which is simply your username and password joined and base64-encoded — encoding is not encryption, so Basic auth must only ever be used over HTTPS, never plain HTTP, or the credentials are effectively sent in the clear.
Who created curl, and is it still actively maintained?
curl was created in 1998 by Daniel Stenberg, originally to pull currency exchange rates for an IRC bot. Stenberg has remained its lead maintainer for essentially curl's entire history and continues actively developing it today. Far from a hobby project, curl is now one of the most widely deployed pieces of software in the world — bundled into operating systems, embedded devices, and countless applications — and its security and correctness are taken correspondingly seriously by a large contributor community.
Similar Tools
Report a Problem
curl Command Builder
Comments
No comments yet — be the first to write one!