Class HttpContinue


  • public class HttpContinue
    extends java.lang.Object
    Class that provides support for dealing with HTTP 100 (Continue) responses.

    Note that if a client is pipelining some requests and sending continue for others this could cause problems if the pipelining buffer is enabled.

    Author:
    Stuart Douglas
    • Constructor Detail

      • HttpContinue

        public HttpContinue()
    • Method Detail

      • requiresContinueResponse

        public static boolean requiresContinueResponse​(HttpServerExchange exchange)
        Returns true if this exchange requires the server to send a 100 (Continue) response.
        Parameters:
        exchange - The exchange
        Returns:
        true if the server needs to send a continue response
      • requiresContinueResponse

        public static boolean requiresContinueResponse​(HeaderMap requestHeaders)
      • sendContinueResponse

        public static void sendContinueResponse​(HttpServerExchange exchange,
                                                IoCallback callback)
        Sends a continuation using async IO, and calls back when it is complete.
        Parameters:
        exchange - The exchange
        callback - The completion callback
      • createResponseSender

        public static HttpContinue.ContinueResponseSender createResponseSender​(HttpServerExchange exchange)
                                                                        throws java.io.IOException
        Creates a response sender that can be used to send a HTTP 100-continue response.
        Parameters:
        exchange - The exchange
        Returns:
        The response sender
        Throws:
        java.io.IOException
      • markContinueResponseSent

        public static void markContinueResponseSent​(HttpServerExchange exchange)
        Marks a continue response as already having been sent. In general this should only be used by low level handlers than need fine grained control over the continue response.
        Parameters:
        exchange - The exchange
      • sendContinueResponseBlocking

        public static void sendContinueResponseBlocking​(HttpServerExchange exchange)
                                                 throws java.io.IOException
        Sends a continue response using blocking IO
        Parameters:
        exchange - The exchange
        Throws:
        java.io.IOException
      • rejectExchange

        public static void rejectExchange​(HttpServerExchange exchange)
        Sets a 417 response code and ends the exchange.
        Parameters:
        exchange - The exchange to reject