如何计算服务器发送给我的 100 个继续的数量?
我正在使用 Apache Commons HttpClient 3.1,我发现 Sun 的 HttpURLConnection 会从流中删除 100 个继续。
因此,我似乎无法获得 100 Continue,因为它们显然被 Sun 的代码删除了。
我无法升级到 HttpClient 4.0,因为这需要对现有代码进行许多更改,因此解决方案必须是 3.1 或不冲突的版本。
有什么想法吗?
谢谢
I am using Apache Commons HttpClient 3.1, and I found that HttpURLConnection from Sun drops the 100 Continues from the stream.
So therefore I don't seem able to get the 100 Continue as they are apparently dropped by Sun's code.
I am unable to move forward to HttpClient 4.0 as that would require many changes to already existing code so the solution has to either be 3.1 or something that doesn't conflict.
Any ideas?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了解决方案!
覆盖 processStatusLine 并检查状态 100。
请记住,前 100 个是预期的(服务器告诉我可以继续 POST),在我的情况下,我可以安全地忽略该状态。这样我就可以获得服务器响应的所有信息。
I found the solution!
Over-ride processStatusLine and check for status of 100.
Remember that the first 100 is expected (server telling me I can continue with the POST), and in my case I can safely ignore that one. This way I get all the information that my server is responding with.
似乎这种行为是预期的,并被此问题拒绝:https://bugs。 java.com/bugdatabase/view_bug?bug_id=4396798。
It seems like this behavior is expected and was rejected by this issue: https://bugs.java.com/bugdatabase/view_bug?bug_id=4396798.