@Immutable public class BasicResponseHandler extends java.lang.Object implements ResponseHandler<java.lang.String>
ResponseHandler that returns the response body as a String
for successful (2xx) responses. If the response code was >= 300, the response
body is consumed and an HttpResponseException is thrown.
If this is used with
HttpClient.execute(
depends.org.apache.http.client.methods.HttpUriRequest, ResponseHandler),
HttpClient may handle redirects (3xx responses) internally.| 构造器和说明 |
|---|
BasicResponseHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.String |
handleResponse(HttpResponse response)
Returns the response body as a String if the response was successful (a
2xx status code).
|
public java.lang.String handleResponse(HttpResponse response) throws HttpResponseException, java.io.IOException
HttpResponseException.handleResponse 在接口中 ResponseHandler<java.lang.String>response - The response to processClientProtocolException - in case of an http protocol errorjava.io.IOException - in case of a problem or the connection was abortedHttpResponseException