public static FullHttpRequest toFullHttpRequest ( int streamId , Http2Headers http2Headers , ByteBufAllocator alloc , boolean validateHttpHeaders ) throws Http2Exception { // HTTP/2 does not define a way to carry the version identifier that is included in the HTTP/1.1 request line. final CharSequence method = checkNotNull ( http2Headers . method ( ) , "method header cannot be null in conversion to HTTP/1.x" ) ; final CharSequence path = checkNotNull ( http2Headers . path ( ) , "path header cannot be null in conversion to HTTP/1.x" ) ; FullHttpRequest msg = new DefaultFullHttpRequest ( HttpVersion . HTTP_1_1 , HttpMethod . valueOf ( method . toString ( ) ) , path . toString ( ) , alloc . buffer ( ) , validateHttpHeaders ) ; try { addHttp2ToHttpHeaders ( streamId , http2Headers , msg , false ) ; } catch ( Http2Exception e ) { msg . release ( ) ; throw e ; } catch ( Throwable t ) { msg . release ( ) ; throw streamError ( streamId , PROTOCOL_ERROR , t , "HTTP/2 to HTTP/1.x headers conversion error" ) ; } return msg ; }
Create a new object to contain the request data