Package com.networknt.handler
Interface Interceptor
- All Superinterfaces:
io.undertow.server.HttpHandler,LightHttpHandler,MiddlewareHandler
- All Known Subinterfaces:
RequestInterceptor,ResponseInterceptor
-
Field Summary
FieldsFields inherited from interface com.networknt.handler.LightHttpHandler
AUDIT_CONFIG_NAME, AUDIT_ON_ERROR, AUDIT_STACK_TRACE, auditConfig, auditOnError, auditStackTrace, config, CONFIG_NAME, ERROR_NOT_DEFINED, logger -
Method Summary
Modifier and TypeMethodDescriptionfindMatchingPrefix(String url, List<String> prefixes) default booleanisFormData(String contentType) Checks to see if the request is multipart/form-data or x-www-form-urlencoded.default booleanisJsonData(String contentType) Checks to see if the request is application/json.default booleanChecks to see if the request is text/xml, text/plain, or application/xml.default booleanparseJsonArrayObject(io.undertow.server.HttpServerExchange ex, io.undertow.util.AttachmentKey<Object> key, String str) default booleanparseJsonMapObject(io.undertow.server.HttpServerExchange ex, io.undertow.util.AttachmentKey<Object> key, String str) default booleanshouldAttachBody(io.undertow.util.HeaderMap headers) Check to see if the current request/response is compatible to have body data extracted.Methods inherited from interface io.undertow.server.HttpHandler
handleRequestMethods inherited from interface com.networknt.handler.LightHttpHandler
setExchangeStatus, setExchangeStatus, setExchangeStatusMethods inherited from interface com.networknt.handler.MiddlewareHandler
addHandlerMDCContext, getNext, isEnabled, register, reload, setNext
-
Field Details
-
CONTENT_TYPE_MISMATCH
- See Also:
-
JSON_MAP_OBJECT_STARTING_CHAR
static final char JSON_MAP_OBJECT_STARTING_CHAR- See Also:
-
JSON_ARRAY_OBJECT_STARTING_CHAR
static final char JSON_ARRAY_OBJECT_STARTING_CHAR- See Also:
-
-
Method Details
-
isXmlData
Checks to see if the request is text/xml, text/plain, or application/xml.- Parameters:
contentType- - Content-Type header from exchange- Returns:
- - true/false
-
isFormData
Checks to see if the request is multipart/form-data or x-www-form-urlencoded.- Parameters:
contentType- - Content-Type header from exchange- Returns:
- - true/false
-
isJsonData
Checks to see if the request is application/json.- Parameters:
contentType- - Content-Type header from exchange.- Returns:
- - true/false
-
shouldAttachBody
default boolean shouldAttachBody(io.undertow.util.HeaderMap headers) Check to see if the current request/response is compatible to have body data extracted.- Parameters:
headers- - http headers (request/response headers)- Returns:
- - return true if we should run the body parser.
-
parseJsonMapObject
-
parseJsonArrayObject
-
findMatchingPrefix
-