axios封装进阶——》3

Post请求参数序列化

在POST请求中Content-Type常见有一下3种形式:

  1. Content-Type:application/json
  2. Content-Type:multipart/form-data
  3. Content-Type: application/x-www-form-urlencoded
    大多数情况下使用application/json形式,Axios默认以这种形式工作,给后端接口传递参数直接丢在其data参数就行了。
    image

image
image
image
注:补充进阶2的auth.js文件
image

posted @ 2021-11-04 14:56  举个栗子走天下  阅读(27)  评论(0)    收藏  举报