在分析这个问题之前我们需要了解一下什么是“Expect 100 Continue”和它到底是怎么去影响我们的http请求的,我们可以先看一下官方的解释是:
Activates 'Expect: 100-Continue' handshake for the entity enclosing methods. The 'Expect: 100-Continue' handshake allows a client that is sending a request message with a request body to determine if the origin server is willing to accept the request (based on the request headers) before the client sends the request body.
The use of the 'Expect: 100-continue' handshake can result in noticeable performance improvement for entity enclosing requests (such asPOST andPUT) that require the target server's authentication.
'Expect: 100-continue' handshake should be used with caution, as it may cause problems with HTTP servers and proxies that do not supportHTTP/1.1 protocol.
Expect 100 Continue其实是http协议1.1中的一个header属性, 就是说如果设置了Expe

本文介绍了Http协议中的'Expect 100-Continue'机制,它允许客户端在发送请求体前确认服务器是否接受请求。启用此功能可能导致性能影响,但在需要服务器认证的场景下能提高效率。HttpProtocolParams的setUseExpectContinu函数用于设置这一行为,建议谨慎使用,并在不支持HTTP 1.1的服务器上避免使用。
最低0.47元/天 解锁文章
9781

被折叠的 条评论
为什么被折叠?



