About API Request Builder & cURL Generator
Building API requests by hand is tedious and error-prone. This tool lets you visually construct HTTP requests — set the method, URL, headers, and body — then instantly generates ready-to-use code in cURL, PHP (Guzzle), JavaScript (fetch and axios), and Python (requests). You can also import an existing cURL command to populate the form, edit it, and re-export. Share requests with teammates via a shareable URL that encodes the full request definition.
How to Use
- Choose the HTTP method and enter the API endpoint URL.
- Add headers as key-value pairs (e.g., Authorization, Content-Type).
- Enter a request body for POST/PUT/PATCH requests.
- Click "Generate Code" to get snippets in all languages.
- Use tabs to switch between cURL, PHP, JS, and Python output.
Key Features
- ✓ Visual HTTP request builder with method, URL, headers, and body
- ✓ Generate cURL commands from form input
- ✓ Generate PHP (Guzzle), JavaScript (fetch, axios), and Python (requests) code
- ✓ Import existing cURL commands to populate the form
- ✓ JSON body validation and auto-formatting
- ✓ Shareable URLs that encode the full request definition
- ✓ Copy-to-clipboard for each code snippet
Common Use Cases
- • Prototyping API calls before writing code
- • Generating boilerplate HTTP client code in multiple languages
- • Sharing API request definitions with teammates
- • Converting between cURL and programming language code
- • Validating JSON request bodies before sending
Frequently Asked Questions
How do I convert cURL to PHP?
Switch to the "Import cURL" tab, paste your cURL command, and click Import. Then switch to Build Request and click Generate Code. The PHP (Guzzle) tab shows the converted code.
How do I build an HTTP request online?
Use the Build Request form: select a method (GET, POST, etc.), enter the URL, add headers, and optionally a request body. Click Generate Code to get code snippets in cURL, PHP, JavaScript, and Python.
Can I share a request with my team?
Yes. After generating code, click "Copy Share URL" to get a link that encodes the entire request. Anyone who opens the link sees the form pre-filled with your request.
What languages are supported?
The tool generates code for cURL, PHP (Guzzle), JavaScript (fetch and axios), and Python (requests). All snippets include headers, body, and authentication when provided.
Related Tools
Convert curl commands to PHP, JavaScript, or Python code.
Pretty print, minify, and validate JSON.
Reference for all HTTP status codes.
Encode and decode URL components.
Decode, inspect, and verify JSON Web Tokens.