axios post x-ww mode request data format

       // use Axios, to determine x-www json format or formats, Axios json default format, if the format is x-ww needs to be done as follows: 
        the let URL = "/ Hehe / Site / getComment" ; 
        the let Data = { 
            Order: . 1 , 
            pageSize: 10 , 
            type: . 1 , 
            EID: 133 535 , 
            P: . 1 
        }; 
        const Options = { 
            Method: "the POST" , 
            headers: { "Content-type": " file application / X-WWW-form -urlencoded " }, 
            Data: qs.stringify (Data),// need to download qs dependent, cnpm i qs, node in the queryString () has the same effect 
            URL, 
        } 
        the this . $ Axios (Options) .then ((Data) => { 
            the console.log (Data) 
        })              



    
        // VUE. config.js cross-domain configuration agent 
module.exports = { 
  devserver: { 
    proxy: {
       '/ Hehe' : { 
        target: 'https://www.missevan.com' , 
        changeOrigin: to true , 
        pathRewrite: {
           '^ / Hehe ':' ' 
        } 
      } 
    } 
  } 
}

 

https://www.missevan.com/site/getcomment first test postman in the interface can not be used:

Guess you like

Origin www.cnblogs.com/wuqilang/p/11455491.html