且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在jQuery ajax中使用GET请求发送原始数据?

更新时间:2022-04-01 23:41:53

GET请求不应包含正文.

GET requests are not expected to have bodies.

是真的.HTTP规范中明确未定义带有主体的GET请求的行为.

This is true. The behaviour of a GET request with a body is explicitly undefined in the HTTP specification.

XMLHttpRequest(jQuery Ajax使用的底层API)不支持发送带有GET请求的请求正文.

XMLHttpRequest (the underlying API used by jQuery Ajax) does not support the sending of a request body with a GET request.

执行此操作的唯一方法是通过服务器代理请求.

The only way to do this would be to proxy the request through your server.