Skip to content
TabKiwiTabKiwi

Axios Code Generator

Turn a request form into an axios.request() call with headers, auth, params and a JSON or form body.

DeveloperRuns in your browser. Your files never leave this device.
Loading tool…

About this tool

Fill in the method, URL, headers and body and get a ready-to-run Axios call that uses the library's own config options: JSON bodies go in data as a plain object, basic credentials use the auth option and multipart uploads use FormData. That keeps the snippet short and idiomatic rather than a literal translation. The request is assembled in your browser only.

How to use Axios Code Generator

  1. Enter the URL and pick a method.
  2. Add query parameters, headers and authentication.
  3. Choose a body type and fill it in.
  4. Copy the Axios code.

Frequently asked questions

Why is there no Content-Type header for JSON?

Axios serialises a plain object in data to JSON and sets Content-Type: application/json on its own, so the snippet leaves it out unless you added it yourself.

What does maxRedirects: 0 do?

In Node.js it stops Axios from following redirects, matching curl's default. Browsers always follow redirects and ignore this option. Turn on Follow redirects in Options to remove it.

More Developer tools

View all 91 →