Class HttpResponse


  • public class HttpResponse
    extends Object
    • Field Detail

      • statusCode

        private int statusCode
      • charset

        private String charset
      • contentLength

        private long contentLength
      • headers

        private org.apache.commons.httpclient.Header[] headers
    • Constructor Detail

      • HttpResponse

        public HttpResponse​(int statusCode,
                            String body,
                            String charset,
                            long contentLength)
        Constructor
        Parameters:
        statusCode - status code
        body - body string
        charset - charset
        contentLength - content length
    • Method Detail

      • getStatusCode

        public int getStatusCode()
        Ge the http status code
        Returns:
        status code
      • setStatusCode

        public void setStatusCode​(int statusCode)
        Set the http status code
        Parameters:
        statusCode - status code
      • getBody

        public String getBody()
        Get the body
        Returns:
        string body
      • setBody

        public void setBody​(String body)
        Set the body
        Parameters:
        body - string
      • getCharset

        public String getCharset()
        Get the charset
        Returns:
        charset
      • setCharset

        public void setCharset​(String charset)
        Set the charset
        Parameters:
        charset - charset
      • getContentLength

        public long getContentLength()
        Get content length
        Returns:
        content length
      • setContentLength

        public void setContentLength​(long contentLength)
        Set content length
        Parameters:
        contentLength - content length
      • getHeaders

        public org.apache.commons.httpclient.Header[] getHeaders()
        Get HTTP response headers
        Returns:
        headers
      • getHeader

        public org.apache.commons.httpclient.Header getHeader​(String name)
        Get HTTP response header giving a header name
        Parameters:
        name - name of the header
        Returns:
        header
      • setHeaders

        public void setHeaders​(org.apache.commons.httpclient.Header[] headers)
        Set HTTP response headers
        Parameters:
        headers - headers
      • toString

        public String toString()
        Get the string representation of the object
        Overrides:
        toString in class Object
        Returns:
        string