org.apache.hc.core5.http.io.support

## Class BasicHttpServerExpectationDecorator

- java.lang.Object
- - org.apache.hc.core5.http.io.support.BasicHttpServerExpectationDecorator

- All Implemented Interfaces:
    HttpServerRequestHandler

      public class BasicHttpServerExpectationDecorator
      extends Object
      implements HttpServerRequestHandler

  `HttpServerRequestHandler` implementation that adds support for the Expect-Continue handshake to an existing `HttpServerRequestHandler`.
  Since:
    5.0

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.hc.core5.http.io.HttpServerRequestHandler

      `HttpServerRequestHandler.ResponseTrigger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicHttpServerExpectationDecorator(HttpServerRequestHandler requestHandler)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `handle(ClassicHttpRequest request, HttpServerRequestHandler.ResponseTrigger responseTrigger, HttpContext context)` Handles the request and submits a final response to be sent back to the client.
    `protected ClassicHttpResponse` | `verify(ClassicHttpRequest request, HttpContext context)` Verifies the HTTP request and decides whether it meets server expectations and the request processing can continue.

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

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

- - ### Constructor Detail

    - #### BasicHttpServerExpectationDecorator

          public BasicHttpServerExpectationDecorator(HttpServerRequestHandler requestHandler)

  - ### Method Detail

    - #### verify

          protected ClassicHttpResponse verify(ClassicHttpRequest request,
                                               HttpContext context)

      Verifies the HTTP request and decides whether it meets server expectations and the request processing can continue.
      Parameters:
        `request` - the incoming HTTP request.
        `context` - the actual execution context.
      Returns:
        `null` if the request meets expectations or a final HTTP response with an error status representing the cause of expectation failure.

    - #### handle

          public final void handle(ClassicHttpRequest request,
                                   HttpServerRequestHandler.ResponseTrigger responseTrigger,
                                   HttpContext context)
                            throws HttpException,
                                   IOException

      Description copied from interface: `HttpServerRequestHandler`
      Handles the request and submits a final response to be sent back to the client.
      Specified by:
        `handle` in interface `HttpServerRequestHandler`
      Parameters:
        `request` - the actual request.
        `responseTrigger` - the response trigger.
        `context` - the actual execution context.
      Throws:
        `HttpException`
        `IOException`

Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.