wx.request 可以不设置 content-type, 对于 get 请求,可以不设置吧?
发布于 5 年前 作者 yetao 1779 次浏览 来自 问答

业务上需要对于 get 请求,不设置 content-type ,请问在小程序上如何实现呢?我看文档,不能不设置呀,设置为空字符串,实际上发起的又是 application/json。

3 回复

强迫症是病,得治

比如看这个请求,就可以没有 content-type。

get 请求都没有 body, 为啥要设置 content-type 呢。

你就算不写content-type,请求都会默认有content-type的。

http基础。到底是你不懂还是后端不懂

回到顶部