Example usage for io.netty.handler.codec.http2 HttpConversionUtil toHttpResponse

List of usage examples for io.netty.handler.codec.http2 HttpConversionUtil toHttpResponse

Introduction

In this page you can find the example usage for io.netty.handler.codec.http2 HttpConversionUtil toHttpResponse.

Prototype

public static HttpResponse toHttpResponse(final int streamId, final Http2Headers http2Headers,
        final boolean validateHttpHeaders) throws Http2Exception 

Source Link

Document

Create a new object to contain the response data.

Usage

From source file:io.gatling.http.client.impl.ChunkedInboundHttp2ToHttpAdapter.java

License:Apache License

private void convertAndFire(ChannelHandlerContext ctx, int streamId, Http2Headers headers, boolean endOfStream)
        throws Http2Exception {
    HttpResponse response = HttpConversionUtil.toHttpResponse(streamId, headers, validateHttpHeaders);
    ctx.fireChannelRead(response);/*  ww  w. j  av a  2s  .  c  o  m*/
    if (endOfStream) {
        ctx.fireChannelRead(new Http2Content(LastHttpContent.EMPTY_LAST_CONTENT, streamId));
    }
}