HTTP请求中的form data,request payload,query string parameters几种传参方式

1.query string parameters

export const editeLedTemplate = params => axios({
    url: url + '/led-stencil/change',
    method: 'PUT',
    params
})

HTTP请求中的form data,request payload,query string parameters几种传参方式_第1张图片

2.form data

export const addLedTemplate = params => axios.post( url + '/led-stencil/add',JSON.stringify(params))

3.request payload

export const login = params => axios.post(BASE_URL + '/login/login', params)

export const getTechnologyResultDetail = params => axios({
    url: BASE_URL + '/result/resultsData_detail',
    method: 'POST',
    headers: {
        'userId': sessionStorage.getItem('userId')
    },
    data: params
})

4.网络请求工具之axios,vue-resouce,fetch

参考:https://blog.csdn.net/liuqiao0327/article/details/106894445?utm_medium=distribute.pc_feed.374114.nonecase&depth_1-utm_source=distribute.pc_feed.374114.nonecase

你可能感兴趣的:(axios)