HttpURLConnection.getResponseCode() returns -1 on second invocation

前端 未结 5 1002
你的背包
你的背包 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 05:58

    Can you verify that the connection is not getting closed before you finish reading the response? Maybe HttpClient parses the response code right away, and saves it for future queries, however HttpURLConnection could be returning -1 once the connection is closed?

提交回复
热议问题