How to use curl command with http/2 on MacOS X

To use curl with HTTP/2 on MacOS X, you need to have a version of curl that supports HTTP/2 and a version of OpenSSL that supports ALPN (Application-Layer Protocol Negotiation). To check if your system meets these requirements, run the following command:

curl --version

If the output shows that curl supports HTTP/2, you can use the --http2 option with curl to make HTTP/2 requests, like this:

curl --http2 https://example.com

If curl does not support HTTP/2, you need to upgrade curl and/or OpenSSL. You can do this by installing a newer version of curl, or by compiling curl and OpenSSL from source. Once you have a version of curl that supports HTTP/2, you can use it as described above.

Leave a Comment