Interface ProxyHttpClient


  • public interface ProxyHttpClient
    Interface that allows proxying of HTTP requests in controllers and filters.
    Since:
    2.0.0
    • Method Detail

      • proxy

        org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> proxy​(@NonNull
                                                                                      io.micronaut.http.HttpRequest<?> request)
        Proxy the given request and emit the response. This method expects the full absolute URL to be included in the request. If a relative URL is specified then the method will try to resolve the URI for the current server otherwise an exception will be thrown.
        Parameters:
        request - The request
        Returns:
        A publisher that emits the response.
      • proxy

        default org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> proxy​(@NonNull
                                                                                              io.micronaut.http.HttpRequest<?> request,
                                                                                              @NonNull
                                                                                              ProxyRequestOptions options)
        Proxy the given request and emit the response. This method expects the full absolute URL to be included in the request. If a relative URL is specified then the method will try to resolve the URI for the current server otherwise an exception will be thrown.
        Parameters:
        request - The request
        options - Further options for the proxy request
        Returns:
        A publisher that emits the response.
        Since:
        3.5.0
      • create

        static ProxyHttpClient create​(@Nullable
                                      java.net.URL url)
        Create a new ProxyHttpClient. Note that this method should only be used outside of the context of a Micronaut application. The returned ProxyHttpClient is not subject to dependency injection. The creator is responsible for closing the client to avoid leaking connections. Within a Micronaut application use Inject to inject a client instead.
        Parameters:
        url - The base URL
        Returns:
        The client
      • create

        static ProxyHttpClient create​(@Nullable
                                      java.net.URL url,
                                      @NonNull
                                      HttpClientConfiguration configuration)
        Create a new ProxyHttpClient with the specified configuration. Note that this method should only be used outside of the context of an application. Within Micronaut use Inject to inject a client instead
        Parameters:
        url - The base URL
        configuration - the client configuration
        Returns:
        The client
        Since:
        2.2.0