Class RequestDecodeHandler

  • All Implemented Interfaces:
    com.networknt.handler.LightHttpHandler, com.networknt.handler.MiddlewareHandler, io.undertow.server.HttpHandler

    public class RequestDecodeHandler
    extends java.lang.Object
    implements com.networknt.handler.MiddlewareHandler
    This middleware handler is responsible for decode gzip request body in the request chain. It is used to handle request that is gziped from the client. If you have request in both json and gzip content, you can safely wire in this handler in the chain as it is only called when the content is encoded in gzip.
    Author:
    Steve Hu
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static RequestDecodeConfig config  
      • Fields inherited from interface com.networknt.handler.LightHttpHandler

        ERROR_NOT_DEFINED, logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.undertow.server.HttpHandler getNext()  
      void handleRequest​(io.undertow.server.HttpServerExchange exchange)  
      boolean isEnabled()  
      void register()  
      com.networknt.handler.MiddlewareHandler setNext​(io.undertow.server.HttpHandler next)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.networknt.handler.LightHttpHandler

        setExchangeStatus, setExchangeStatus
    • Constructor Detail

      • RequestDecodeHandler

        public RequestDecodeHandler()
    • Method Detail

      • getNext

        public io.undertow.server.HttpHandler getNext()
        Specified by:
        getNext in interface com.networknt.handler.MiddlewareHandler
      • setNext

        public com.networknt.handler.MiddlewareHandler setNext​(io.undertow.server.HttpHandler next)
        Specified by:
        setNext in interface com.networknt.handler.MiddlewareHandler
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface com.networknt.handler.MiddlewareHandler
      • register

        public void register()
        Specified by:
        register in interface com.networknt.handler.MiddlewareHandler
      • handleRequest

        public void handleRequest​(io.undertow.server.HttpServerExchange exchange)
                           throws java.lang.Exception
        Specified by:
        handleRequest in interface io.undertow.server.HttpHandler
        Throws:
        java.lang.Exception