public static Map < String , String > getRequestParameters ( HttpServerExchange exchange ) { Objects . requireNonNull ( exchange , Required . HTTP_SERVER_EXCHANGE . toString ( ) ) ; final Map < String , String > requestParamater = new HashMap <> ( ) ; final Map < String , Deque < String > > queryParameters = exchange . getQueryParameters ( ) ; queryParameters . putAll ( exchange . getPathParameters ( ) ) ; queryParameters . entrySet ( ) . forEach ( entry -> requestParamater . put ( entry . getKey ( ) , entry . getValue ( ) . element ( ) ) ) ; return requestParamater ; }
Converts request and query parameter into a single map