fetch err : "Body not allowed for GET or HEAD requests"

在使用 fetch 的时候 报了  "Body not allowed for GET or HEAD requests" 这个错。

代码如下:

一番google , 找到答案了。

1、由于 ‘method’ 拼写错误。 (我可不是因为这个...)

2、 ‘GET’ 请求, HTTP/1.1协议规范里 对于 ‘GET’ 请求不支持在 body 里携带数据,参数只能通过URL传递。具体可参考 http://stackoverflow.com/ques...

引申内容:

名字叫  fetch-jsonp 也会出现类似的情况

猜你喜欢

转载自www.cnblogs.com/wennice/p/9849190.html
今日推荐