Package io.undertow.server.protocol.http
Class HttpContinue
- java.lang.Object
-
- io.undertow.server.protocol.http.HttpContinue
-
public class HttpContinue extends 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceHttpContinue.ContinueResponseSenderA continue response that is in the process of being sent.
-
Constructor Summary
Constructors Constructor Description HttpContinue()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HttpContinue.ContinueResponseSendercreateResponseSender(HttpServerExchange exchange)Creates a response sender that can be used to send a HTTP 100-continue response.static booleanisContinueResponseSent(HttpServerExchange exchange)static voidmarkContinueResponseSent(HttpServerExchange exchange)Marks a continue response as already having been sent.static voidrejectExchange(HttpServerExchange exchange)Sets a 417 response code and ends the exchange.static booleanrequiresContinueResponse(HttpServerExchange exchange)Returns true if this exchange requires the server to send a 100 (Continue) response.static booleanrequiresContinueResponse(HeaderMap requestHeaders)static voidsendContinueResponse(HttpServerExchange exchange, IoCallback callback)Sends a continuation using async IO, and calls back when it is complete.static voidsendContinueResponseBlocking(HttpServerExchange exchange)Sends a continue response using blocking IO
-
-
-
Field Detail
-
CONTINUE
public static final String CONTINUE
- See Also:
- Constant Field Values
-
-
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:
trueif the server needs to send a continue response
-
requiresContinueResponse
public static boolean requiresContinueResponse(HeaderMap requestHeaders)
-
isContinueResponseSent
public static boolean isContinueResponseSent(HttpServerExchange exchange)
-
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 exchangecallback- The completion callback
-
createResponseSender
public static HttpContinue.ContinueResponseSender createResponseSender(HttpServerExchange exchange) throws 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:
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 IOException
Sends a continue response using blocking IO- Parameters:
exchange- The exchange- Throws:
IOException
-
rejectExchange
public static void rejectExchange(HttpServerExchange exchange)
Sets a 417 response code and ends the exchange.- Parameters:
exchange- The exchange to reject
-
-