uni-app 请求后台接收为null 空值

'Content-Type': 'application/x-www-form-urlencoded'

uni.request({
    
      
    url: 'https://www.example.com/request', //仅为示例,并非真实接口地址。  
    header: {
    
      
        'Content-Type': 'application/x-www-form-urlencoded'  
    },  
    data: {
    
      
        name: 'name',  
        age: 18  
    },  
    method: 'POST',  
    success: function(res) {
    
      
        console.log(res.data);  
    }  
});

猜你喜欢

转载自blog.csdn.net/weixin_44433499/article/details/107553035