JavaScript is disabled on your browser.
Skip navigation links

AWS SDK for Java 1.x API Reference - 1.12.793

We announced the upcoming end-of-support for AWS SDK for Java (v1). We recommend that you migrate to AWS SDK for Java v2. For dates, additional details, and information on how to migrate, please refer to the linked announcement.
com.amazonaws.http

Class HttpResponse



  • public class HttpResponse
    extends Object 
    Represents an HTTP response returned by an AWS service in response to a service request.
    • Constructor Detail

      • HttpResponse

        public HttpResponse(Request<?> request,
         org.apache.http.client.methods.HttpRequestBase httpRequest)
        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.
        Throws:
        IOException
      • HttpResponse

        public HttpResponse(Request<?> request,
         org.apache.http.client.methods.HttpRequestBase httpRequest,
         org.apache.http.protocol.HttpContext context)
    • Method Detail

      • getRequest

        public Request<?> 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

        public Map<String,String> getHeaders()
        Deprecated. See getAllHeaders()
        Returns the HTTP headers returned with this response.
        Returns:
        The set of HTTP headers returned with this HTTP response.
      • getAllHeaders

        public Map<String,List<String>> getAllHeaders()
        Returns all of the HTTP headers returned with this response. Unlike getHeaders(), this returns all values returned with the same field-name, rather than the last seen value.
        Returns:
        All the headers for a response.
      • getHeaderValues

        public List<String> getHeaderValues(String header)
        Returns all the values for a given header name.
        Parameters:
        header - The header name.
        Returns:
        The values for the given header.
      • getHeader

        public String getHeader(String headerName)
        Deprecated. See getHeaderValues(String)
        Looks up a header by name and returns its value. Does case insensitive comparison.
        Parameters:
        headerName - Name of header to get value for.
        Returns:
        The header value of the given header. Null if header is not present.
      • addHeader

        public void addHeader(String name,
         String value)
        Adds an HTTP header to the set associated with this response.
        Parameters:
        name - The name of the HTTP header.
        value - The value of the HTTP header.
      • setContent

        public void setContent(InputStream content)
        Sets the input stream containing the response content.
        Parameters:
        content - The input stream containing the response content.
      • getContent

        public InputStream getContent()
        Returns the input stream containing the response content.
        Returns:
        The input stream containing the response content.
      • setStatusText

        public void setStatusText(String statusText)
        Sets the HTTP status text returned with this response.
        Parameters:
        statusText - The HTTP status text (ex: "Not found") returned with this response.
      • getStatusText

        public String 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.
      • getCRC32Checksum

        public long getCRC32Checksum()
        Returns the CRC32 checksum calculated by the underlying CRC32ChecksumCalculatingInputStream.
        Returns:
        The CRC32 checksum.
Skip navigation links

AltStyle によって変換されたページ (->オリジナル) /