go TypeError: Failed to execute ‘fetch‘ on ‘Window‘: Request with GET/HEAD method cannot have body.

文章目录
前言问题分析解决方法

前言
使用swagger测试一个Get路由时,想要传入form-data数据时报错TypeError: Failed to execute ‘fetch‘ on ‘Window‘: Request with GET/HEAD method cannot have body.
问题分析
GET把参数包含在URL中 POST把通过request body 传递参数。 所以Get路由不能获取body中的form-data数据。
解决方法
换成POST或者把参数放到URL中。

go TypeError: Failed to execute ‘fetch‘ on ‘Window‘: Request with GET/HEAD method cannot have body.最先出现在Python成神之路

版权声明:
作者:主机优惠
链接:https://www.techfm.club/p/20183.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>