【发布时间】:2017-04-30 22:35:25
【问题描述】:
AngularJs $http.post() 请求无法正常工作
我想将一项任务存储到我的数据库中。如果assignedMember 中的数据量大于175,它不会发送得到404 错误,但如果assignedMember 中的数据量小于175,它将发送成功并存储我的数据库。关于这个的任何想法。我不觉得我有什么问题。请帮帮我谢谢
这是我的 json 数据
$scope.task=
{
"title": "My Title",
"description": "My Description",
"assignedMember": [
{
"userId": "51b701dae4b0dd92df2c32d1",
"status": "ASSIGNED"
},
{
"userId": "52de0811e4b04615ce7ed6bd",
"status": "ASSIGNED"
},
{
"userId": "559f8e97e4b0a5cdcd66bb76",
"status": "ASSIGNED"
},
.
.
.
.
.
.etc upto 500 data
]
}
这是我的发帖请求 api
var responsePromise = $http.post("api/tasks",$scope.task);
responsePromise.success(function(data, status, headers, config) {
alert("Data created successfully");
});
responsePromise.error(function(data, status, headers, config) {
alert("Error")
});
如果我发送此 json 时分配的成员大小超过 175 或浏览器中的内容长度大于 24580,我收到 404 错误
如果我发送此 json 时分配的成员大小小于 175 或浏览器中的内容长度小于 10080,它将成功
如果我收到 404 错误,我的浏览器控制台是这样的
Request header
-------------
Host: localhost
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0
Accept: application/json, text/plain, /
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json;charset=utf-8
Referer: http://localhost/login.do
Content-Length: 24580
Response header
--------------
Connection: close
Content-Encoding: gzip
Content-Type: text/html
Date: Thu, 15 Dec 2016 14:21:56 GMT
Server: nginx/1.10.1
Transfer-Encoding: chunked
我的 nginx 服务器有什么限制吗?请帮帮我
发布请求没有限制吗?并且获取请求限制为 2048KB
实际上我是通过邮局发送的,所以我面临什么问题?
【问题讨论】: