Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable HTTP/2 for GET queries #149

Closed
Zabrane opened this issue Nov 25, 2023 · 2 comments
Closed

How to disable HTTP/2 for GET queries #149

Zabrane opened this issue Nov 25, 2023 · 2 comments

Comments

@Zabrane
Copy link

Zabrane commented Nov 25, 2023

Hi @puzza007

I'm trying to send a GET request without HTTP2.
Even if I specify {pipelining, nothing}, this query seems to be sent using HTTP2.

{ok, _} = application:ensure_all_started(katipo).
Pool = api_server.
{ok, _} = katipo_pool:start(Pool, 2, [{pipelining, nothing}]).
ReqHeaders = [{<<"User-Agent">>, <<"katipo">>}].
Req = #{url => <<"https://www.vancleefarpels.com/">>,
        method => get,
        headers => ReqHeaders,
        connecttimeout_ms => 5000,
        ssl_verifyhost => false,
        ssl_verifypeer => false}.
{ok, #{status := 200,
       headers := RespHeaders,
       cookiejar := CookieJar,
       body := RespBody}} = katipo:req(Pool, Req).
       
 ** exception error: no match of right hand side value 
   {error,#{code => unknown_error,
                 message => <<"HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)">>}}

Is there a way to tell katipo to not use HTTP/2?
Many thanks

@puzza007
Copy link
Owner

puzza007 commented Nov 25, 2023 via email

@Zabrane
Copy link
Author

Zabrane commented Nov 25, 2023

@puzza007 oh, missed that one:

Req = #{url => <<"https://www.vancleefarpels.com/">>,
        method => get,
        http_version => curl_http_version_1_1,
        headers => ReqHeaders,
        connecttimeout_ms => 5000,
        ssl_verifyhost => false,
        ssl_verifypeer => false}.

Thanks a lot.

@Zabrane Zabrane closed this as completed Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants