← All Tools
HTTP Request Builder
Build a request and get code that runs as-is in curl, JavaScript, Python, PHP, Go, Java, C# or Ruby. Quotes, backslashes, line breaks, $ or a leading @ are sent exactly as typed.
This page only writes code: it never sends your request, and everything stays in your browser.
Request Configuration
Generated Code
Saved Requests (Local Storage)
Saved in this browser only. Values of headers and query parameters whose name looks like a credential (Authorization, Cookie, anything with key, token, secret, password or session in the name) and a user:password in the URL are left out. The body is saved as typed, so leave passwords out of it.
How the code is checked
- Every value goes through the string escaping of the chosen language, so text such as
",\,${x},#{x}, a backtick or$(...)stays plain data and never becomes code. - curl uses
--data-raw(a body starting with@is not read as a file),--headfor HEAD and--globoffwhen the URL has brackets. - A valid JSON body becomes a native object in JavaScript and Python (
true/nullbecomeTrue/None). Invalid JSON, and JSON that would not arrive the same way (integers from 253 up, decimals with 16 or more significant digits,-0, duplicate keys, integer-like keys a JavaScript object would reorder) are sent as the exact text. - A user name and password in the URL become an
Authorization: Basicheader (fetch refuses credentials in a URL), a header with an empty value is written asName;for curl and PHP so it is still sent, and a%that does not start an escape is written as%25. - Java leaves out the headers HttpClient refuses (Host, Content-Length, Connection, Expect, Upgrade); C# puts Content-Type on the body as .NET requires.
- Each language was tested by running the generated program against a local echo server with tricky inputs and comparing the method, path, headers and body that arrived.
HTTP Reference
HTTP Methods
GET- Retrieve resourcePOST- Create resourcePUT- Replace resourcePATCH- Partial updateDELETE- Remove resourceHEAD- Headers only
Common Headers
Content-TypeAuthorizationAcceptUser-AgentCache-ControlX-API-Key
Content Types
application/jsonapplication/x-www-form-urlencodedmultipart/form-datatext/plaintext/xml
Status Codes
200- OK201- Created400- Bad Request401- Unauthorized404- Not Found500- Server Error