为什么我会收到“错误解析HTTP请求标头"消息?发布JSON字符串时? [英] Why do I get "Error parsing HTTP request header" when POSTing a JSON string?

查看:1044
本文介绍了为什么我会收到“错误解析HTTP请求标头"消息?发布JSON字符串时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从浏览器向我的服务器(本地主机)发送POST请求.我的请求网址是:

 http://localhost:8080/myPath/myServlet?requestData={  .......//Json String......};

requestData是一个json字符串(我正在使用GSON进行此操作.)一切正常,直到json字符串中的数据超过特定限制.说,我在json字符串中发送对象数组.如果列表中的对象数超过67,则出现以下错误:

 AM org.apache.coyote.http11.AbstractHttp11Processor process
 INFO: Error parsing HTTP request header
 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.

为什么会这样?我很困惑.为什么会发生这种情况,需要采取什么措施来解决此问题? 我想了解其背后的原因,因为我不明白在经过特定数量的对象后,它突然停止工作,并且在控制台中出现此错误.

解决方案

我遇到了类似的问题,我正在发送一个POST请求(使用Firefox的RESTClient插件),并在请求正文中添加了数据,并且收到了相同的消息. /p>

在我的情况下,这是因为我试图在未配置HTTPS的本地tomcat实例中使​​用HTTPS协议.

I am trying to send a POST request from browser to my server(local host). My request URL is :

 http://localhost:8080/myPath/myServlet?requestData={  .......//Json String......};

requestData is a json String (I am using GSON for the purpose.) Everything is working fine until the data in the json string exceeds a particular limit. Say, I am sending array of objects in the json string. If the number of objects in the list exceed 67 then I get following error :

 AM org.apache.coyote.http11.AbstractHttp11Processor process
 INFO: Error parsing HTTP request header
 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.

Why is this so? I am totally confused. Why does this happen and what needs to be done to fix this? I want to understand the reason behind this, for I don't understand that after particular number of objects it suddenly stops working and I get this error in my console.

解决方案

I had a similar issue, I was sending a POST request (using RESTClient plugin for Firefox) with data in the request body and was receiving the same message.

In my case this happened because I was trying to use HTTPS protocol in a local tomcat instance where HTTPS was not configured.

这篇关于为什么我会收到“错误解析HTTP请求标头"消息?发布JSON字符串时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆