Class HttpResponse
java.lang.Object
com.amazonaws.http.HttpResponse
Represents an HTTP response returned by an AWS service in response to a
service request.
-
Constructor Summary
ConstructorsConstructorDescriptionHttpResponse(Request<?> request, org.apache.http.client.methods.HttpRequestBase httpRequest) Constructs a new HttpResponse associated with the specified request. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an HTTP header to the set associated with this response.Returns the input stream containing the response content.Returns the HTTP headers returned with this response.org.apache.http.client.methods.HttpRequestBaseReturns the original http request associated with this response.Request<?> Returns the original request associated with this response.intReturns the HTTP status code (ex: 200, 404, etc) associated with this response.Returns the HTTP status text associated with this response.voidsetContent(InputStream content) Sets the input stream containing the response content.voidsetStatusCode(int statusCode) Sets the HTTP status code that was returned with this response.voidsetStatusText(String statusText) Sets the HTTP status text returned with this response.
-
Constructor Details
-
HttpResponse
Constructs a new HttpResponse associated with the specified request.- Parameters:
request- The associated request that generated this response.httpRequest- The underlying http request that generated this response.
-
-
Method Details
-
getRequest
Returns the original request associated with this response.- Returns:
- The original request associated with this response.
-
getHttpRequest
public org.apache.http.client.methods.HttpRequestBase getHttpRequest()Returns the original http request associated with this response.- Returns:
- The original http request associated with this response.
-
getHeaders
-
addHeader
-
setContent
Sets the input stream containing the response content.- Parameters:
content- The input stream containing the response content.
-
getContent
Returns the input stream containing the response content.- Returns:
- The input stream containing the response content.
-
setStatusText
Sets the HTTP status text returned with this response.- Parameters:
statusText- The HTTP status text (ex: "Not found") returned with this response.
-
getStatusText
Returns the HTTP status text associated with this response.- Returns:
- The HTTP status text associated with this response.
-
setStatusCode
public void setStatusCode(int statusCode) Sets the HTTP status code that was returned with this response.- Parameters:
statusCode- The HTTP status code (ex: 200, 404, etc) associated with this response.
-
getStatusCode
public int getStatusCode()Returns the HTTP status code (ex: 200, 404, etc) associated with this response.- Returns:
- The HTTP status code associated with this response.
-