### php.java.bridge.http

# Class HttpResponse

- `java.lang.Object`

- `php.java.bridge.http.HttpResponse`

`public class HttpResponse`
`extends java.lang.Object`

A simple HTTP response implementation.

Author:
  jostb

## Constructor Summary

`HttpResponse(java.io.OutputStream outputStream)`
  Create a new HTTP response with the given OutputStream

## Method Summary

`void`

`addHeader(java.lang.String string, java.lang.String string2)`
  Add a response header, in this implementation identical to setHeader

`java.io.OutputStream`

`getOutputStream()`
  Returns the OutputStream of the response.

`void`

`setContentLength(int length)`
  Set the content length of the response.

`void`

`setHeader(java.lang.String string, java.lang.String val)`
  Set the response header

`void`

`setStatus(int code)`
  Set the response status.

### Methods inherited from class java.lang.Object

`equals`, `getClass`, `hashCode`, `notify`, `notifyAll`, `toString`, `wait`, `wait`, `wait`

## Constructor Details

### HttpResponse

    public HttpResponse(java.io.OutputStream outputStream)

> Create a new HTTP response with the given OutputStream

> Parameters:
>   `outputStream` - The OutputStream.

## Method Details

### addHeader

    public void addHeader(java.lang.String string,
                          java.lang.String string2)

> Add a response header, in this implementation identical to setHeader

> Parameters:
>   `string` - The header
>   `string2` - The header value

> See Also:
>   `setHeader(String,String)`

### getOutputStream

    public java.io.OutputStream getOutputStream()

> Returns the OutputStream of the response. setContentLength() must be called before.

> Returns:
>   The OutputStream

> See Also:
>   `HttpRequest.setContentLength(int)`

### setContentLength

    public void setContentLength(int length)
                throws java.io.IOException

> Set the content length of the response. Sets the "Content-Length" header value.

> Parameters:
>   `length` - The content length

> Throws:
>   `java.io.IOException` -

> See Also:
>   `getOutputStream()`

### setHeader

    public void setHeader(java.lang.String string,
                          java.lang.String val)

> Set the response header

> Parameters:
>   `string` - The header key
>   `val` - The header value.

### setStatus

    public void setStatus(int code)

> Set the response status. Not implemented.

> Parameters:
>   `code` -