The method of modifying the interface request header in vue

import api from "../request/index.js";
export const updateUserImg = (params) =>
  api({
    url: "/api/xxx/xxxxxxx",
    method: "post",
    data: params,
    headers: {
      'Content-Type': "text/plain"
    },
  });

You can modify it directly in the headers

Guess you like

Origin blog.csdn.net/weixin_45294459/article/details/127264511