サーバーが受け入れる前に、httpclient がサーバーへの http ポストを試行することがあります。どのような状況で発生するかはわかりませんが、この問題のために投稿に失敗しました。なぜクライアントはこのように振る舞うのですか?
ログの一部を次に示します。
DEBUG org.apache.http.wire - >> "POST /destination-path[\r][\n]"
DEBUG org.apache.http.wire - >> "Content-Length: 594[\r][\n]"
DEBUG org.apache.http.wire - >> "Content-Type: application/json[\r][\n]"
DEBUG org.apache.http.wire - >> "Host: url:port[\r][\n]"
DEBUG org.apache.http.wire - >> "Connection: Keep-Alive[\r][\n]"
DEBUG org.apache.http.wire - >> "Expect: 100-continue[\r][\n]"
DEBUG org.apache.http.wire - >> "[\r][\n]"
DEBUG org.apache.http.headers - >> POST /destination-path HTTP/1.1
DEBUG org.apache.http.headers - >> Content-Length: 594
DEBUG org.apache.http.headers - >> Content-Type: application/json
DEBUG org.apache.http.headers - >> Host: url:port
DEBUG org.apache.http.headers - >> Connection: Keep-Alive
DEBUG org.apache.http.headers - >> Expect: 100-continue
DEBUG org.apache.http.wire - >> "data:mydata"
">>" は、このログの発信操作を示します。これは、クライアントがハンドシェイクのためにサーバーにリクエストを送信していることを意味します。最後のステートメントで、データが送信されようとしています。しかし、この接続に対するサーバーの応答を待つべきでした。通常、この問題は初回接続時に発生します。この失敗した接続試行後の接続は成功しています。