To post request with JSON data with Axios, we call axios.post
with the JSON payload as the 2nd argument.
For instance, we write
const dt = { data: { value: "abc" } };
const request = axios.post(url, dt);
to call axios.post
with the request url
and dt
JSON request payload data.
Therefore, { data: { value: "abc" } }
is the JSON request data for this POST request.