curl / Mailing Lists / curl-library / Single Mail


Re: only http2 mode?

From: Daniel Stenberg via curl-library <>
Date: Wed, 29 Aug 2018 23:11:45 +0200 (CEST)

On Wed, 29 Aug 2018, Stefan Eissing via curl-library wrote:

> In Tests I'd like to make a curl command line requests that should only
> succeed for HTTP/2. Is that possible? '--no-http1.1' does not seem to have
> an effect. Or maybe I am holding it wrong?

We don't really have any logic to make it fail if won't end up using HTTP/2.

A work-around would be to add that check yourself outside of curl. Something
similar to this with the command line tool:

   ver=`curl localhost -w '%{http_version}\n' -so /dev/null`
   if test "$ver" != "2"; then
     echo "did not work"

Received on 2018-08-29