How to wait for Expect 100-continue response in Java using HttpURLConnection

前端 未结 1 1412
一向
一向 2021-01-24 10:30

I am stuck using HttpURLConnection to make a PUT http request to a web-server. I have some code that will make a PUT request just fine, and I can trivially incl

相关标签:
1条回答
  • 2021-01-24 11:28

    It's not obvious to me why they designed it this way, but the code that implements the Expect:100 logic is only used if you have called one of setFixedLengthStreamingMode(int contentlen) or the overload for long or setChunkedStreamingMode(int chunklen) before doing getOutputStream. In this case I recommend the first as simplest.

    0 讨论(0)
提交回复
热议问题