uniapp发送Form Data格式请求

07-12 1374阅读

设置header的Content-Type为 application/x-www-form-urlencoded 即可

uni.request({
    url: '', // 接口url
    data: {
       input: '写一篇一千字的作文'
    }, // 入参
    method: 'POST', // 参数类型
    header: {
      "Content-Type": "application/x-www-form-urlencoded"
    }, // 请求头
    success: (res) => {
      console.log(res, 'hhhhhhhhhhhhh')
    },
    complete: () => {},
    fail: (res) => {}
  })

uniapp发送Form Data格式请求

uniapp发送Form Data格式请求

这世界很喧嚣,做你自己就好

VPS购买请点击我

文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

目录[+]