Package io.vertx.httpproxy

## Interface ProxyResponse

-     public interface ProxyResponse

  Handles the interoperability of the response between the origin and the user agent.
  Author:
    Julien Viet

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `etag()` |
    `Body` | `getBody()` | Get the body of the response.
    `int` | `getStatusCode()` | Get the status code.
    `String` | `getStatusMessage()` | Get the status message.
    `MultiMap` | `headers()` |
    `long` | `maxAge()` |
    `HttpClientResponse` | `proxiedResponse()` |
    `boolean` | `publicCacheControl()` |
    `ProxyResponse` | `putHeader​(CharSequence name, CharSequence value)` | Put an HTTP header.
    `ProxyResponse` | `release()` | Release the proxy response.
    `ProxyRequest` | `request()` | Return the corresponding `ProxyRequest`.
    `Future<Void>` | `send()` | Send the proxies response to the user agent.
    `ProxyResponse` | `setBody​(Body body)` | Set the request body to be sent to the user agent.
    `ProxyResponse` | `setStatusCode​(int sc)` | Set the status code to be sent to the user agent.
    `ProxyResponse` | `setStatusMessage​(String statusMessage)` | Set the status message to be sent to the user agent.

- - ### Method Detail

    - #### request

          ProxyRequest request()

      Return the corresponding `ProxyRequest`.
      Returns:
        the proxy request

    - #### getStatusCode

          int getStatusCode()

      Get the status code.
      Returns:
        the status code to be sent to the user agent

    - #### setStatusCode

          ProxyResponse setStatusCode​(int sc)

      Set the status code to be sent to the user agent.

      The initial value is the proxied response status code.

      Parameters:
        `sc` - the status code
      Returns:
        a reference to this, so the API can be used fluently

    - #### getStatusMessage

          String getStatusMessage()

      Get the status message.
      Returns:
        the status message to be sent to the user agent

    - #### setStatusMessage

          ProxyResponse setStatusMessage​(String statusMessage)

      Set the status message to be sent to the user agent.

      The initial value is the proxied response status message.

      Parameters:
        `statusMessage` - the status message
      Returns:
        a reference to this, so the API can be used fluently

    - #### headers

          MultiMap headers()

      Returns:
        the headers that will be sent to the user agent, the returned headers can be modified. The headers map is populated with the proxied response headers

    - #### putHeader

          ProxyResponse putHeader​(CharSequence name,
                                  CharSequence value)

      Put an HTTP header.
      Parameters:
        `name` - The header name
        `value` - The header value
      Returns:
        a reference to this, so the API can be used fluently

    - #### getBody

          Body getBody()

      Get the body of the response.
      Returns:
        the response body to be sent to the user agent

    - #### setBody

          ProxyResponse setBody​(Body body)

      Set the request body to be sent to the user agent.

      The initial request body value is the proxied response body.

      Parameters:
        `body` - the new body
      Returns:
        a reference to this, so the API can be used fluently

    - #### proxiedResponse

          HttpClientResponse proxiedResponse()

      Returns:
        the proxied HTTP server response

    - #### publicCacheControl

          boolean publicCacheControl()

    - #### maxAge

          long maxAge()

    - #### etag

          String etag()

      Returns:
        the `etag` sent by the origin response

    - #### send

          Future<Void> send()

      Send the proxies response to the user agent.

    - #### release

          ProxyResponse release()

      Release the proxy response.

      The proxied response is resumed, no HTTP response is sent to the user-agent