xref: /curl/docs/cmdline-opts/http2.md (revision e7219c2b)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Long: http2
5Tags: Versions
6Protocols: HTTP
7Added: 7.33.0
8Mutexed: http1.1 http1.0 http2-prior-knowledge http3
9Requires: HTTP/2
10Help: Use HTTP/2
11Category: http
12Multi: mutex
13See-also:
14  - http1.1
15  - http3
16  - no-alpn
17Example:
18  - --http2 $URL
19---
20
21# `--http2`
22
23Use HTTP/2.
24
25For HTTPS, this means curl negotiates HTTP/2 in the TLS handshake. curl does
26this by default.
27
28For HTTP, this means curl attempts to upgrade the request to HTTP/2 using the
29Upgrade: request header.
30
31When curl uses HTTP/2 over HTTPS, it does not itself insist on TLS 1.2 or
32higher even though that is required by the specification. A user can add this
33version requirement with --tlsv1.2.
34