x-www-form-urlencoded 传参


  post(url, params) {
            const config = {
                method: 'post',
                url: url,
                headers:{
                  "Content-type":"application/x-www-form-urlencoded" 
                },
                data:qs.stringify(params)||{}
            };

此时后端似乎不需要在映射请求体 @requestBody  有请求体的话 后端会收不到数据; 这边需要用qs模块来处理一下,听说用 JSON.stringfy()也行,我这边试了一下不行 不知道是不是操作问题。

 

转自 https://blog.csdn.net/clli_Chain/article/details/107659939


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM