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 and Description
    --- | ---
    `ProxyResponse` | `bodyFilter(java.util.function.Function<ReadStream<Buffer>,ReadStream<Buffer>> filter)` Set a body filter.
    `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()`
    `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 proxy 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 inbound 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 inbound 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 inbound 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 outbound response body.

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

    - #### bodyFilter

          ProxyResponse bodyFilter(java.util.function.Function<ReadStream<Buffer>,ReadStream<Buffer>> filter)

      Set a body filter.

      The body filter can rewrite the response body sent to the user agent.

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

    - #### publicCacheControl

          boolean publicCacheControl()

    - #### maxAge

          long maxAge()

    - #### etag

          String etag()

      Returns:
        the `etag` sent by the origin response

    - #### send

          Future<Void> send()

      Send the proxy response to the user agent.

    - #### release

          ProxyResponse release()

      Release the proxy response.

      The HTTP client inbound response is resumed, no HTTP inbound server response is sent.

Copyright © 2021 Eclipse. All rights reserved.