io.vertx.httpproxy

## Interface ProxyRequest

-     public interface ProxyRequest

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

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `absoluteURI()`
    `ProxyRequest` | `bodyFilter(java.util.function.Function<ReadStream<Buffer>,ReadStream<Buffer>> filter)` Set a body filter.
    `Body` | `getBody()`
    `HttpMethod` | `getMethod()`
    `String` | `getURI()`
    `MultiMap` | `headers()`
    `HttpServerRequest` | `outboundRequest()`
    `default Future<Void>` | `proxy(HttpClientRequest inboundRequest)` Proxy this outbound request and response to the origin server using the specified inbound request.
    `ProxyRequest` | `putHeader(CharSequence name, CharSequence value)` Put an HTTP header
    `ProxyRequest` | `release()` Release the proxy request.
    `ProxyResponse` | `response()` Create and return the proxy response.
    `static ProxyRequest` | `reverseProxy(HttpServerRequest outboundRequest)` Create a new `ProxyRequest` instance, the outbound request will be paused.
    `Future<ProxyResponse>` | `send(HttpClientRequest inboundRequest)` Send this request to the origin server using the specified inbound request.
    `ProxyRequest` | `setBody(Body body)` Set the request body to be sent to the origin server.
    `ProxyRequest` | `setMethod(HttpMethod method)` Set the HTTP method to be sent to the origin server.
    `ProxyRequest` | `setURI(String uri)` Set the request URI to be sent to the origin server.
    `HttpVersion` | `version()`

- - ### Method Detail

    - #### reverseProxy

          static ProxyRequest reverseProxy(HttpServerRequest outboundRequest)

      Create a new `ProxyRequest` instance, the outbound request will be paused.
      Parameters:
        `outboundRequest` - the `HttpServerRequest` of the user agent
      Returns:
        a reference to this, so the API can be used fluently

    - #### version

          HttpVersion version()

      Returns:
        the HTTP version of the outbound request

    - #### absoluteURI

          String absoluteURI()

      Returns:
        the absolute URI of the outbound request

    - #### getMethod

          HttpMethod getMethod()

      Returns:
        the HTTP method to be sent to the origin server.

    - #### setMethod

          ProxyRequest setMethod(HttpMethod method)

      Set the HTTP method to be sent to the origin server.

      The initial HTTP method value is the outbound request HTTP method.

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

    - #### getURI

          String getURI()

      Returns:
        the request URI to be sent to the origin server.

    - #### setURI

          ProxyRequest setURI(String uri)

      Set the request URI to be sent to the origin server.

      The initial request URI value is the outbound request URI.

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

    - #### getBody

          Body getBody()

      Returns:
        the request body to be sent to the origin server.

    - #### setBody

          ProxyRequest setBody(Body body)

      Set the request body to be sent to the origin server.

      The initial request body value is the outbound request body.

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

    - #### headers

          MultiMap headers()

      Returns:
        the headers that will be sent to the origin server, the returned headers can be modified. The headers map is populated with the outbound request headers

    - #### putHeader

          ProxyRequest 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

    - #### bodyFilter

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

      Set a body filter.

      The body filter can rewrite the request body sent to the origin server.

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

    - #### proxy

          default Future<Void> proxy(HttpClientRequest inboundRequest)

      Proxy this outbound request and response to the origin server using the specified inbound request.
      Parameters:
        `inboundRequest` - the request connected to the origin server

    - #### send

          Future<ProxyResponse> send(HttpClientRequest inboundRequest)

      Send this request to the origin server using the specified inbound request.

      The `completionHandler` will be called with the proxy response sent by the origin.

      Parameters:
        `inboundRequest` - the request connected to the origin server

    - #### release

          ProxyRequest release()

      Release the proxy request.

      The HTTP server request is resumed, no HTTP server response is sent.

      Returns:
        a reference to this, so the API can be used fluently

    - #### outboundRequest

          HttpServerRequest outboundRequest()

      Returns:
        the outbound HTTP server request

    - #### response

          ProxyResponse response()

      Create and return the proxy response.
      Returns:
        the proxy response

Copyright © 2021 Eclipse. All rights reserved.