public static class HTTPRequestHandler.HTTPRequestResponse extends Object
Constructor and Description |
---|
HTTPRequestResponse(Exception exception)
Standard public constructor for an error case, where an error has
occurred and request couldn't be executed because of an internal
exception (rather than an error received from the remote server).
|
HTTPRequestResponse(int statusCode,
String reasonPhrase,
String redirectionURL,
String redirectionHTTPMethod,
org.apache.http.Header[] responseContentTypes,
String responseBody)
Standard public constructor for a regular case, where all values are
known and the request has succeeded.
|
Modifier and Type | Method and Description |
---|---|
Exception |
getException() |
org.apache.http.Header[] |
getHeaders() |
List<String> |
getHeadersAsStrings() |
String |
getReasonPhrase() |
String |
getRedirectionHTTPMethod() |
String |
getRedirectionURL() |
Object |
getResponseBody() |
org.apache.http.Header[] |
getResponseContentTypes() |
int |
getStatusCode() |
boolean |
hasException() |
boolean |
hasServerError() |
void |
setHeaders(org.apache.http.Header[] allHeaders) |
public HTTPRequestResponse(int statusCode, String reasonPhrase, String redirectionURL, String redirectionHTTPMethod, org.apache.http.Header[] responseContentTypes, String responseBody)
statusCode
- reasonPhrase
- redirection
- responseContentTypes
- responseBody
- public HTTPRequestResponse(Exception exception)
exception
- public void setHeaders(org.apache.http.Header[] allHeaders)
public org.apache.http.Header[] getHeaders()
public int getStatusCode()
public String getReasonPhrase()
public String getRedirectionURL()
public String getRedirectionHTTPMethod()
public org.apache.http.Header[] getResponseContentTypes()
public Object getResponseBody()
public boolean hasException()
true
if an exception has occurred while the HTTP
request was executed. (E.g. this doesn't indicate a server
error - just that the request couldn't be successfully
executed. It could have been a network timeout, etc).public Exception getException()
public boolean hasServerError()
true
if HTTP code of server response is either
4xx or 5xx.Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.