Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.transport.http
Class HttpResponse

    java.lang.Object
      org.mule.transport.http.HttpResponse

    public class HttpResponse

extends Object

A generic HTTP response wrapper.

Field Summary
`static String` | `DEFAULT_CONTENT_CHARSET`

Constructor Summary
`HttpResponse()`
`HttpResponse(StatusLine statusline, Header[] headers, InputStream content)`

Method Summary
`void` | `addHeader(Header header)`
`boolean` | `containsHeader(String name)`
`void` | `disableKeepAlive(boolean keepalive)`
`OutputHandler` | `getBody()`
`String` | `getBodyAsString()`
`String` | `getCharset()`
`long` | `getContentLength()`
`String` | `getFallbackCharset()`
`Header` | `getFirstHeader(String name)`
`Iterator` | `getHeaderIterator()`
`Header[]` | `getHeaders()`
`HttpVersion` | `getHttpVersion()`
`String` | `getPhrase()`
`int` | `getStatuscode()` Deprecated. use `getStatusCode()` instead
`int` | `getStatusCode()`
`String` | `getStatusLine()`
`boolean` | `hasBody()`
`boolean` | `isKeepAlive()`
`void` | `removeHeaders(String s)`
`void` | `setBody(MuleMessage msg)`
`void` | `setBody(OutputHandler outputHandler)`
`void` | `setBody(String string)`
`void` | `setFallbackCharset(String overrideCharset)`
`void` | `setHeader(Header header)`
`void` | `setHeaders(Header[] headers)`
`void` | `setKeepAlive(boolean keepAlive)`
`void` | `setStatusLine(HttpVersion ver, int statuscode)`
`void` | `setStatusLine(HttpVersion ver, int statuscode, String phrase)`
`protected void` | `setupKeepAliveFromRequestVersion(HttpVersion version)` The HTTTP spec suggests that for HTTP 1.1 persistent connections should be used, for HTTP 1.0 the connection should not be kept alive.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_CONTENT_CHARSET

    public static final String DEFAULT_CONTENT_CHARSET

See Also:
  Constant Field Values

Constructor Detail

### HttpResponse

    public HttpResponse()

### HttpResponse

    public HttpResponse(StatusLine statusline,
                        Header[] headers,
                        InputStream content)
                 throws IOException

Throws:
  `IOException`

Method Detail

### setStatusLine

    public void setStatusLine(HttpVersion ver,
                              int statuscode,
                              String phrase)

### setStatusLine

    public void setStatusLine(HttpVersion ver,
                              int statuscode)

### getPhrase

    public String getPhrase()

### getStatuscode

    public int getStatuscode()

  Deprecated. use `getStatusCode()` instead

  Returns:
    HTTP status code

### getStatusCode

    public int getStatusCode()

### getHttpVersion

    public HttpVersion getHttpVersion()

### getStatusLine

    public String getStatusLine()

### containsHeader

    public boolean containsHeader(String name)

### getHeaders

    public Header[] getHeaders()

### getFirstHeader

    public Header getFirstHeader(String name)

### removeHeaders

    public void removeHeaders(String s)

### addHeader

    public void addHeader(Header header)

### setHeader

    public void setHeader(Header header)

### setHeaders

    public void setHeaders(Header[] headers)

### getHeaderIterator

    public Iterator getHeaderIterator()

### getCharset

    public String getCharset()

### getContentLength

    public long getContentLength()

### hasBody

    public boolean hasBody()

### getBody

    public OutputHandler getBody()
                          throws IOException

  Throws:
    `IOException`

### setBody

    public void setBody(MuleMessage msg)
                 throws Exception

  Throws:
    `Exception`

### setBody

    public void setBody(OutputHandler outputHandler)

### setBody

    public void setBody(String string)

### getBodyAsString

    public String getBodyAsString()
                           throws IOException

  Throws:
    `IOException`

### isKeepAlive

    public boolean isKeepAlive()

### setKeepAlive

    public void setKeepAlive(boolean keepAlive)

### setupKeepAliveFromRequestVersion

    protected void setupKeepAliveFromRequestVersion(HttpVersion version)

  The HTTTP spec suggests that for HTTP 1.1 persistent connections should be used, for HTTP 1.0 the connection should not be kept alive. This method sets up the keepAlive flag according to the `version` that was passed in.

### disableKeepAlive

    public void disableKeepAlive(boolean keepalive)

### getFallbackCharset

    public String getFallbackCharset()

### setFallbackCharset

    public void setFallbackCharset(String overrideCharset)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.