美文网首页
axios设置请求头内容

axios设置请求头内容

作者: 小郭米 | 来源:发表于2018-10-20 16:03 被阅读24次

    axios.post(urlString,

        {        data: data

        },

        {

            headers: {

                'token': 'Bearer ',

                "Cookie" : 'sessionId=' + sessionId + '; recId=' + recId

            }

        }

    )

    .then(res => fn)

    .catch(e => fn)

    axios.get(urlString,

        {

            headers: {

                'token': 'Bearer ' ,

                "Cookie" : 'sessionId=' + sessionId + '; recId=' + recId,

            },

            params: {

                param1: string,

                param2: string

            }, 

        }

    )

    .then(res => fn)

    .catch(e => fn)

    相关文章

      网友评论

          本文标题:axios设置请求头内容

          本文链接:https://www.haomeiwen.com/subject/pndmzftx.html