nghttp2 icon indicating copy to clipboard operation
nghttp2 copied to clipboard

send http/2 request which is saved in a text file

Open blueray453 opened this issue 5 years ago • 0 comments

I found in documentation that:

The deflatehd program reads JSON data or HTTP/1-style header fields from stdin and outputs compressed header block in JSON.

I also found that:

With the -t option, the program can accept more familiar HTTP/1 style header field blocks.

I just installed the client and server:

% sudo apt install nghttp2-client
% sudo apt install nghttp2-server
% nghttp --version
nghttp nghttp2/1.40.0

I can do something like the following to send request (which is saved in raw-http.txt) and get response using openssl.

% echo '"'; cat raw-http.txt; echo '"'
"
GET / HTTP/1.0
Host: www.google.com

"
% cat raw-http.txt | openssl s_client -quiet -connect www.google.com:443 2>/dev/null

How can I do it for http/2 headers saved in a txt file. suppose my raw-http2.txt looks like:

:method: GET
:path: /
:scheme: https
:authority: www.google.com
user-agent: nghttp2
accept: */*

So, i think i have to do something like:

% cat raw-http2.txt | deflatehd -t | nghttp -nv www.google.com:443

however it is not working? What am I missing?

blueray453 avatar Dec 04 '20 04:12 blueray453