我使用的服务API有一个给定的GET方法,该方法要求在请求体中发送数据.
正文中所需的数据是由连字符分隔的id列表,可能非常大,因此必须在正文中发送,否则它很可能会出现在浏览器/代理/Web服务器等链中的某个位置.注意:我没有对服务或API的控制权,所以请不要建议更改它.
I am using the following jQuery code however observing the request/response in fiddler I can see that the "data" I am sending is ALWAYS converted and appended to the query string despite me setting the "processData" option to false...
$.ajax({
url: "htttp://api.com/entity/list($body)",
type: "GET",
data: "id1-id2-id3",
contentType: "text/plain",
dataType: "json",
processData: false, // avoid the data being parsed to query string params
success: onSuccess,
error: onError
});
有人知道我如何强制在请求正文中发送"数据"值吗?