SmartTechnology solutions for business

HTTP Request Code Builder

Set a method, headers, and body, then generate curl and fetch examples. It does not send the request.

One header per line, as Name: value. Use a placeholder instead of a real token.

GET and HEAD requests send no body.

Code for

Nothing is sent from this page. Run the code yourself to make the request.

Your result

Type an address and the request code appears here.

How to use it

  1. Choose the method and type the address.
  2. Add headers (one per line) and a body if needed.
  3. Pick the language and copy or download the code.

Examples

  • POST with a JSON bodyPOST https://api.example.com/v1/orders curl -X POST '…' -H 'Content-Type: application/json' --data-raw '{…}'
  • GET without a bodyGET https://smart.example curl 'https://smart.example/'
  • A quote in the bodyit's 'it'\''s'
Tool details and privacy

Set up an HTTP request in a clear form and get its code in three languages: curl for the terminal, fetch for JavaScript, and requests for Python.

Copying a request from API docs into a working curl line often trips over quotes inside the body.

Options

  • The body is hidden for GET and HEAD, which do not send one.
  • If the body looks like JSON but is not valid, a warning gives the line and column, and the body is copied as written.
  • Without a scheme, https:// is assumed.

Limits

  • Nothing is sent from this page; run the code yourself.
  • Use a placeholder such as YOUR_TOKEN rather than a real token.

Privacy

What you type stays in your browser. Nothing is uploaded or saved on the server.

Questions

Does the page send the request?

No. It only writes the code.

Why --data-raw?

It sends the body as is, without treating @ as a file name.

Are headers checked?

Each header name is checked, and a bad line is named by its number.

Is what I type uploaded?

No.

Related tools

All tools