- All Superinterfaces:
HttpHandler
- All Known Implementing Classes:
FileHandler,PredicateHandler,RootHandler,SSEHandler,ThrottledHandler,TimeoutHandler
A http handler that uses a
Note: Http handlers will not throw an exception in the main thread, you must use a try-catch to expose them.
Note: An exchange must be sent or closed, otherwise the connection may resend the request until it gets response or times out.
SimpleHttpExchange. All handlers in this library can be used with a standard HttpServer.
Note: Http handlers will not throw an exception in the main thread, you must use a try-catch to expose them.
Note: An exchange must be sent or closed, otherwise the connection may resend the request until it gets response or times out.
- Since:
- 5.0.0
- Version:
- 5.0.0
- Author:
- Katsute
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidhandle(HttpExchange exchange) Deprecated.voidhandle(SimpleHttpExchange exchange) Handles an exchange.
-
Method Details
-
handle
Deprecated.Do not override this method, it will causehandle(SimpleHttpExchange)to not work. Usehandle(SimpleHttpExchange)instead.- Specified by:
handlein interfaceHttpHandler- Parameters:
exchange- the exchange containing the request from the client and used to send the response- Throws:
IOException- IO exception- See Also:
-
handle
Handles an exchange.
Http handlers will not throw an exception in the main thread, you must use a try-catch to expose them. All requests must be closed withHttpExchange.close(), otherwise the handler will rerun the request multiple times.- Parameters:
exchange- http exchange- Throws:
IOException- IO exception- Since:
- 5.0.0
- See Also:
-
handle(SimpleHttpExchange)