GET请求-为什么我的URI这么长? [英] GET Request - Why is my URI so long?
问题描述
我正在使用PARSE API发出GET请求.我收到"414请求URI太大"错误,但我不明白为什么.这是我的请求的代码:
I'm making a GET request using the PARSE API. I'm getting a "414 Request-URI Too Large" error, but I don't understand why. Here is the code for my request:
$.ajax({
url : 'https://api.parse.com/1/classes/chats',
type : 'GET',
dataType: 'json',
data : JSON.stringify({
order: '-createdAt',
}),
success : function(data) {
handleData(data)
},
error : function(data) {
console.log('error: ' + data);
}
});
推荐答案
因为服务器是这样说的,例如这样配置您要查询的服务.来自维基百科
Because the server says so, e.g. the service you're querying against is so configured. From Wikipedia
414 Request-URI Too Long
提供的URI太长,服务器无法处理- HTTP/1.1规范.通常,将太多数据编码为GET请求的查询字符串的结果,在这种情况下,应将其转换为POST请求.
414 Request-URI Too Long
The URI provided was too long for the server to process - The HTTP/1.1 Specification. Often the result of too much data being encoded as a query-string of a GET request, in which case it should be converted to a POST request.
这篇关于GET请求-为什么我的URI这么长?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!