Check if Website Supports HTTP/2 with Curl

Check if Website Supports HTTP/2 with Curl

Website performance is important for user satisfaction and search engine ranking. HTTP/2 provides faster and more efficient web browsing experiences compared to its predecessor, HTTP/1.1. However, not all websites have adopted HTTP/2, and determining whether a particular site supports it can be crucial for developers, system administrators, and curious users alike. This tutorial demonstrates how to check if a website supports HTTP/2 with a Curl.

The --http2 option can be used to check if a particular website supports the HTTP/2 protocol.

curl --http2 -I https://httpbin.org/get

If the website supports HTTP/2, you'll see HTTP/2.0 200 instead of HTTP/1.1 200 in the header. Example:

HTTP/2 200 
date: Thu, 09 May 2024 15:21:02 GMT
content-type: application/json
content-length: 256
server: gunicorn/19.9.0
access-control-allow-origin: *
access-control-allow-credentials: true

Leave a Comment

Cancel reply

Your email address will not be published.