Search in sources :

Example 31 with Http2Request

use of com.webpieces.hpack.api.dto.Http2Request in project webpieces by deanhiller.

the class Requests method createRequest.

static Http2Request createRequest(boolean eos) {
    List<Http2Header> headers = new ArrayList<>();
    headers.add(new Http2Header(Http2HeaderName.METHOD, "GET"));
    headers.add(new Http2Header(Http2HeaderName.AUTHORITY, "somehost.com"));
    headers.add(new Http2Header(Http2HeaderName.PATH, "/"));
    headers.add(new Http2Header(Http2HeaderName.SCHEME, "http"));
    headers.add(new Http2Header(Http2HeaderName.HOST, "somehost.com"));
    headers.add(new Http2Header(Http2HeaderName.ACCEPT, "*/*"));
    headers.add(new Http2Header(Http2HeaderName.ACCEPT_ENCODING, "gzip, deflate"));
    headers.add(new Http2Header(Http2HeaderName.USER_AGENT, "webpieces/1.15.0"));
    Http2Request request = new Http2Request(headers);
    request.setEndOfStream(eos);
    return request;
}
Also used : Http2Request(com.webpieces.hpack.api.dto.Http2Request) Http2Header(com.webpieces.http2parser.api.dto.lib.Http2Header) ArrayList(java.util.ArrayList)

Aggregations

Http2Request (com.webpieces.hpack.api.dto.Http2Request)31 Test (org.junit.Test)22 StreamWriter (com.webpieces.http2engine.api.StreamWriter)13 MockResponseListener (org.webpieces.http2client.mock.MockResponseListener)13 DataFrame (com.webpieces.http2parser.api.dto.DataFrame)12 DataWrapper (org.webpieces.data.api.DataWrapper)11 Http2Response (com.webpieces.hpack.api.dto.Http2Response)10 GoAwayFrame (com.webpieces.http2parser.api.dto.GoAwayFrame)10 MockStreamWriter (org.webpieces.http2client.mock.MockStreamWriter)9 PassedIn (org.webpieces.httpfrontend2.api.mock2.MockHttp2RequestListener.PassedIn)9 Http2Msg (com.webpieces.http2parser.api.dto.lib.Http2Msg)7 Http2Push (com.webpieces.hpack.api.dto.Http2Push)5 ConnectionClosedException (com.webpieces.http2engine.api.ConnectionClosedException)5 ShutdownStream (com.webpieces.http2engine.api.error.ShutdownStream)5 Http2Header (com.webpieces.http2parser.api.dto.lib.Http2Header)4 MockStreamWriter (org.webpieces.httpfrontend2.api.mock2.MockStreamWriter)4 PushPromiseListener (com.webpieces.http2engine.api.PushPromiseListener)3 CancelReason (com.webpieces.http2parser.api.dto.CancelReason)3 InetSocketAddress (java.net.InetSocketAddress)3 ArrayList (java.util.ArrayList)3