Axios failed to request to add header information?

axios, is used in the project, but the header information needs to be modified, although the global method in the document is used, as follows

axios.defaults.headers.post ["Content-Type"] = "application/x-www-form-urlencoded";

Content-Type application/json.

Mar.09,2021

  1. GET has no request body, so there is no Content-Type.
  2. you set the content-type of post

params is requested in URL, and data is placed in body when it is in POST mode. There is no data, in your code, so there will be no request body

.
Menu