Get HTTP code from org.apache.http.HttpResponse

后端 未结 4 1727
执笔经年
执笔经年 2021-02-03 16:38

I\'m using the org.apache.http.HttpResponse class in my Java application, and I need to be able to get the HTTP status code. If I used .toString() on i

4条回答
  •  自闭症患者
    2021-02-03 17:01

    I have used httpResponse.getStatusLine().getStatusCode() and have found this to reliably return the integer http status code.

提交回复
热议问题