Skip to content
⚠ TESTING ENVIRONMENT You are viewing a testing copy of Tolioo. Changes here do not affect the live website.

HTTP Request Builder

Build an HTTP request visually and get ready-to-use code in cURL, JavaScript, Python, PHP, Laravel and Go. Import cURL commands too. Fast, free and no signup.

  • 100% free
  • No Signup
  • 7 code formats

Request

Query parameters are added to the end of the URL.

Import from a cURL command
Your Privacy Matters

This tool only builds code. It never sends your request anywhere, and nothing you enter is saved or uploaded.

ADVERTISEMENT
Demo Ad 728 x 90

How to build an HTTP request

  1. 1

    Set method and URL

    Pick GET, POST, PUT, PATCH or another method and enter the endpoint URL.

  2. 2

    Add details

    Add query params, headers, authorization and a JSON, form or raw body.

  3. 3

    Copy the code

    Choose cURL, JavaScript, Python, PHP, Laravel or Go and copy the code.

API DEVELOPER GUIDE

HTTP Request Builder – Build Requests and Generate cURL, Fetch, Python and PHP Code Online

Looking for a free HTTP request builder? Choose a method, enter a URL, add query parameters, headers, authorization and a request body, and instantly get ready-to-use code for cURL, JavaScript fetch, axios, Python requests, PHP cURL, the Laravel HTTP client and Go. You can also paste an existing cURL command and convert it to code in another language. The tool works as an HTTP request generator, a cURL command builder and a cURL to code converter, with no signup and nothing to install. It does not send your request, so you can safely build requests for any API without CORS limits or accounts. Copy the code into your project, your terminal or your API documentation and test it where it belongs.

This HTTP request builder is also a cURL command generator, a cURL to Python converter and a quick code generator for JavaScript fetch, axios, PHP, Laravel and Go. Developers use it to document an API call, share a request with a teammate, move a command from the terminal into code, or start an integration without writing the boilerplate by hand. It builds the request and generates the code. It does not send anything, so there are no CORS limits and nothing leaves your browser.

HTTP Request Builder

Build GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS requests with query parameters, headers, authorization and JSON, form or raw bodies, all in one clear form.

cURL Command Generator

Get a clean multi-line cURL command you can run in your terminal, or paste a cURL command and import it to edit it visually and convert it to other languages.

Code for 7 Formats

Generate cURL, JavaScript fetch, axios, Python requests, PHP cURL, Laravel Http client and Go net/http code from the same request with one click.

What Is an HTTP Request?

An HTTP request is a message that a client, such as a browser, a mobile app or a script, sends to a server to ask for data or to make a change. Every request has a method that says what you want to do, a URL that says where to send it, headers that give extra information, and sometimes a body that carries data. APIs use HTTP requests so that different programs can talk to each other. Building a request correctly, with the right method, headers and body format, is the first step in working with any REST API.

How to Use the HTTP Request Builder

Creating a request and generating code takes only a few steps.

  1. Choose the method and enter the URL: Select GET, POST, PUT, PATCH, DELETE, HEAD or OPTIONS, then type the full endpoint address.
  2. Add query parameters: Use the Params tab for values that belong in the URL query string. They are encoded and appended for you.
  3. Add headers: Use the Headers tab for values such as Accept, User-Agent or custom headers.
  4. Choose a body: Use the Body tab for JSON, form URL-encoded data, form-data or raw text.
  5. Set authorization: Use the Auth tab for a bearer token, basic authentication or an API key.
  6. Pick a language and copy: Select cURL, fetch, axios, Python, PHP, Laravel or Go and copy the generated code.

Convert cURL to Python, JavaScript, PHP and Go

API documentation often shows examples as cURL commands. To use one in your own code, open Import from a cURL command, paste the command and click Import. The builder reads the method, URL, query string, headers, basic authentication, bearer token and body, and fills in the form. Then switch between the code tabs to see the same request in Python requests, JavaScript fetch, axios, PHP, Laravel or Go. The importer understands common options such as -X, -H, -d, --data-raw, --data-urlencode, -F, -u and --url. Options that do not change the request, such as -L, -s and --compressed, are ignored.

HTTP Methods Explained

The method tells the server what kind of action you want. This table summarises the most common ones.

MethodTypical useRequest bodyIdempotent
GETRead a resource or list of resourcesNormally noneYes
POSTCreate a resource or trigger an actionYesNo
PUTReplace a resource completelyYesYes
PATCHUpdate part of a resourceYesNot guaranteed
DELETEDelete a resourceUsually noneYes
HEADSame as GET, but returns headers onlyNoneYes
OPTIONSAsk which methods and options a resource supports, also used in CORS preflight requestsUsually noneYes

An idempotent request has the same effect whether you send it once or several times. GET and HEAD requests normally have no body, so this tool leaves the body out of the code for those methods and shows a warning.

Query Parameters, Headers and Body: Where Does the Data Go?

Query parameters appear after a question mark in the URL and are best for filtering, sorting and paging, such as ?page=2&limit=20. Headers carry information about the request itself, such as the format you accept or your credentials. The body carries the main data you send when creating or updating something. Sensitive values such as passwords and tokens should go in headers or the body over HTTPS, not in the URL, because URLs are often stored in logs and browser history.

Common HTTP Headers

HeaderPurpose
Content-TypeThe format of the request body, such as application/json
AcceptThe response formats the client can handle
AuthorizationCredentials, such as a bearer token or basic authentication
User-AgentIdentifies the client software
Cache-ControlInstructions about caching
Accept-LanguageThe languages the client prefers
X-API-KeyA common custom header name used by some APIs for an API key

Authentication: Bearer Token, Basic Auth and API Key

  • Bearer token: Sends an Authorization header in the form Bearer your-token. It is widely used with OAuth 2.0 and JSON Web Tokens.
  • Basic auth: Sends a username and password encoded with Base64 in the Authorization header. Base64 is not encryption, so use basic authentication only over HTTPS.
  • API key: Sends a key in a header or a query parameter. The name of the header or parameter depends on the API you are using, so check its documentation.

JSON, Form URL-encoded, Form-data and Raw Bodies

  • JSON: The most common format for REST APIs. The tool checks that your JSON is valid and sets Content-Type to application/json.
  • Form URL-encoded: Key and value pairs joined with ampersands, used by many classic forms and some APIs.
  • Form-data: Multipart data, often used when uploading files. This builder supports text fields only.
  • Raw: Any text, such as XML or plain text, with the content type you choose.

Is It Safe to Enter API Keys and Tokens?

Everything you enter stays in your browser. The builder does not send requests, does not save your data and does not upload it. Still, the generated code contains whatever you typed. Turn on Use placeholders for secrets to replace tokens, passwords and API keys with safe placeholder text before you copy code into documentation, tickets or chat. Never commit real secrets to a public repository.

What This Tool Does Not Do

This is a request builder and code generator, not an API client. It does not send requests or show responses, so you run the generated code in your terminal or your project to test the API. It does not upload files, run OAuth sign-in flows or store request history. Generated code is meant as a starting point, so add your own error handling and read the API documentation for details such as rate limits.

Tips for Debugging API Requests

  • Check the status code first: 4xx codes usually mean a problem with your request, and 5xx codes mean a problem on the server.
  • Match Content-Type to the body: Sending JSON with the wrong content type is a very common cause of errors.
  • Validate your JSON: A missing quote or trailing comma will break the request.
  • Use HTTPS: Never send credentials over plain HTTP.
  • Reproduce with cURL: A cURL command is the quickest way to share and repeat a request exactly.

Who Uses an HTTP Request Builder?

  • Backend and frontend developers: Turn API documentation examples into working code.
  • Laravel and PHP developers: Generate Http client and PHP cURL code quickly.
  • QA and DevOps engineers: Create repeatable cURL commands for tests and scripts.
  • Technical writers: Produce clear request examples in several languages.
  • Students: Learn how HTTP methods, headers and bodies fit together.

Example: A JSON POST Request in cURL

This is the kind of command the builder creates when you choose POST, add a JSON body, a Content-Type header and a Bearer token.

curl -X POST "https://api.example.com/users" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"name":"Ali","email":"ali@example.com"}'

Switch to JS fetch, axios, Python, PHP cURL, Laravel or Go and the same request is written in that language. Turn on placeholders for secrets so that real tokens do not end up in code you share.

Which Language Tab Should You Choose?

Code formats generated by the HTTP request builder
Tab Best used for Typical place to run it
cURL Testing an API from the terminal and sharing a request in documentation or bug reports. Command line, CI scripts
JS fetch Calling an API from the browser or modern Node.js without a library. Frontend code, Node.js
axios Projects that already use the axios library. Frontend and Node.js apps
Python Scripts, data jobs and automation that call an API. Python scripts and notebooks
PHP cURL Plain PHP projects with no framework. PHP servers and scripts
Laravel Laravel applications that use the built-in HTTP client. Laravel controllers and jobs
Go Services and tools written in Go. Go programs

HTTP Status Codes Cheat Sheet

After you run the generated code, the server answers with a status code. These are the ones developers see most often when they test APIs.

Common HTTP status codes
Code Meaning What to check
200 OK The request worked. Nothing to fix. Read the response body.
201 Created A new resource was created. Usually the answer to a successful POST.
204 No Content Success with an empty body. Common for DELETE and some PUT requests.
301 / 302 The URL moved. Follow the redirect or update the URL.
400 Bad Request The server could not understand the request. Check the JSON syntax, parameters and required fields.
401 Unauthorized Credentials are missing or wrong. Check the token, API key or Authorization header.
403 Forbidden You are known but not allowed. Check permissions, scopes and IP rules.
404 Not Found The resource or path does not exist. Check the URL, the ID and the API version.
415 Unsupported Media Type The server does not accept your body format. Check the Content-Type header.
422 Unprocessable Entity The data is valid JSON but fails validation. Read the error message for the field names.
429 Too Many Requests You hit a rate limit. Slow down or retry after the time the API gives.
500 / 502 / 503 A server-side problem. Retry later and contact the API owner if it continues.

cURL Options Cheat Sheet

cURL is the most common way to share an HTTP request. These are the options you will see in generated commands.

Common cURL options
Option Meaning Example
-X Sets the HTTP method. -X POST
-H Adds a header. -H "Accept: application/json"
-d Sends request body data. -d '{"a":1}'
-u Sends Basic authentication. -u user:password
-F Sends form-data fields or files. -F "file=@photo.png"
-G Sends data as a query string with GET. -G -d "q=test"
-L Follows redirects. -L
-i Shows response headers. -i

Troubleshooting: Common API Request Problems

  • You get 401 or 403: Check the Authorization type, the token and where an API key must be sent (header or query).
  • You get 415: Add the right Content-Type header, such as application/json.
  • The JSON body is rejected: Click Format JSON to find syntax errors such as missing quotes or trailing commas.
  • Parameters are ignored: Make sure they are in the right place: query parameters in the URL, data in the body.
  • An imported cURL command looks wrong: Check that the command is complete, and remove shell-specific parts such as line continuation errors.
  • Special characters break the URL: Encode values first with our URL Encoder.

Build HTTP Requests on Mobile, Windows, Mac and Linux

The HTTP request builder runs in your web browser, so you can generate cURL, fetch, Python and PHP code online on Android, iPhone, Windows, Mac and Linux. Whether you search for a cURL generator for Mac, a Postman alternative for quick code or a way to convert cURL to code on your phone, the steps are the same: open the page, set the method and URL, add your details and copy the code.

More Free Developer Tools You May Need

API work usually involves a few more small jobs. These related free tools can save you time:

Free HTTP Request Builder With No Signup

Our HTTP request builder is free to use with no registration, no watermark and no limits. Everything runs in your browser. It works on desktop, tablet and mobile.

ADVERTISEMENT
Demo Ad 300 x 250
COMMON QUESTIONS

Frequently Asked Questions About HTTP Request Builders

Quick answers to common questions about building HTTP requests and generating cURL and API code online.

What is an HTTP request builder?

It is a tool that helps you create an HTTP request by filling in the method, URL, parameters, headers, authorization and body, then generates the code for that request in languages such as cURL, JavaScript, Python and PHP.

How do I generate cURL or code from a request?

Fill in the request details, then choose a language tab such as cURL, Python or Laravel. The code updates instantly and you can copy it with one click.

Can I convert a cURL command to Python, JavaScript or PHP?

Yes. Open Import from a cURL command, paste your command and click Import. The builder fills in the request, and you can then switch to Python, JavaScript, PHP, Laravel or Go to copy the converted code.

Does this tool send the request?

No. It only builds the request and generates code. To test an API, run the generated code in your terminal or project. This also means there are no browser CORS limits to worry about.

Is it safe to enter API keys and tokens?

Your input stays in your browser and is not saved or uploaded. The generated code contains what you typed, so use the placeholder option before sharing code, and never publish real secrets.

Which HTTP method should I use: GET, POST, PUT or PATCH?

Use GET to read data, POST to create something or trigger an action, PUT to replace a resource completely, PATCH to change part of a resource, and DELETE to remove it. Always follow the documentation of the API you are using.

Is my data saved or sent anywhere?

No. Everything runs in your browser and nothing you enter is uploaded, saved or shared.

ADVERTISEMENT
Demo Ad 320 x 50