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
- Enter the URL and pick a method.
- Add query parameters, headers and authentication.
- Choose a body type and fill it in.
- 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.