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

前端 未结 9 1839
我在风中等你
我在风中等你 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:14

    This usually happens if you have in the debug watchers calls, such as conn.getResponseCode() or anything that queries the request result before the request was actually issued or completed. This causes, that during debug, a request is performed by the watcher, before having properly set you request, and then it becomes invalid.

提交回复
热议问题