curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

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

From: Ahmad Ismail via curl-users <curl-users_at_cool.haxx.se>
Date: Thu, 3 Dec 2020 07:59:08 +0600

my issue is, i need to see what exactly I am sending or receiving using cli
where the request header is saved in a txt file.

in case of HTTP/1.0, I can do something like the following to send a
request (which is saved in raw-http.txt) and get a response.

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

"
% cat raw-http.txt | curl "telnet://www.google.com:80"

but I am not sure how to deal with it when using HTTP/2, as here the
headers are encoded using hpack.

suppose my raw-http2.txt looks like:

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

So, i think i have to do something like:

% cat raw-http.txt | encode-request | curl "telnet://www.google.com:443"

however I am not sure how to achieve this. any suggestions?

Thanks and Best Regards,
Ahmad Ismail


-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-12-03