HttpURLConnection.getResponseCode() returns -1 on second invocation

前端 未结 5 1011
你的背包
你的背包 2020-11-28 05:24

I seem to be running into a peculiar problem on Android 1.5 when a library I\'m using (signpost 1.1-SNAPSHOT), makes two consecutive connections to a remote server. The sec

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 06:22

    Or, you can set HTTP header in the connection (HttpUrlConnection):

    conn.setRequestProperty("Connection", "close");
    

提交回复
热议问题