setRequestProperty throwing java.lang.IllegalStateException: Cannot set request property after connection is made

前端 未结 9 1829
我在风中等你
我在风中等你 2020-12-17 17:35

I am getting java.lang.IllegalStateException:

java.lang.IllegalStateException: Cannot set request property after connection is made error w

9条回答
  •  無奈伤痛
    2020-12-17 18:03

    I was getting the same exception on setRequestProperty("Range","byte=" + downloadedSize + "-") . After adding connection.setChunkedStreamingMode(0); the issue disappeared

提交回复
热议问题