dd57a2989546244f713b040968f596af1e183615
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_HTTP_VERSION.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at https://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .\"
23 .TH CURLOPT_HTTP_VERSION 3 "17 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
24 .SH NAME
25 CURLOPT_HTTP_VERSION \- specify HTTP protocol version to use
26 .SH SYNOPSIS
27 #include <curl/curl.h>
28
29 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP_VERSION, long version);
30 .SH DESCRIPTION
31 Pass \fIversion\fP a long, set to one of the values described below. They ask
32 libcurl to use the specific HTTP versions. This is not sensible to do unless
33 you have a good reason. You have to set this option if you want to use
34 libcurl's HTTP/2 support.
35
36 Note that the HTTP version is just a request. libcurl will still prioritize to
37 re-use an existing connection so it might then re-use a connection using a
38 HTTP version you haven't asked for.
39
40 .IP CURL_HTTP_VERSION_NONE
41 We don't care about what version the library uses. libcurl will use whatever
42 it thinks fit.
43 .IP CURL_HTTP_VERSION_1_0
44 Enforce HTTP 1.0 requests.
45 .IP CURL_HTTP_VERSION_1_1
46 Enforce HTTP 1.1 requests.
47 .IP CURL_HTTP_VERSION_2_0
48 Attempt HTTP 2 requests. libcurl will fall back to HTTP 1.1 if HTTP 2 can't be
49 negotiated with the server. (Added in 7.33.0)
50
51 The alias \fICURL_HTTP_VERSION_2\fI was added in 7.43.0 to better reflect the
52 actual protocol name.
53 .IP CURL_HTTP_VERSION_2TLS
54 Attempt HTTP 2 over TLS (HTTPS) only. libcurl will fall back to HTTP 1.1 if
55 HTTP 2 can't be negotiated with the HTTPS server. For clear text HTTP servers,
56 libcurl will use 1.1. (Added in 7.47.0)
57 .SH DEFAULT
58 CURL_HTTP_VERSION_NONE
59 .SH PROTOCOLS
60 HTTP
61 .SH EXAMPLE
62 TODO
63 .SH AVAILABILITY
64 Along with HTTP
65 .SH RETURN VALUE
66 Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not.
67 .SH "SEE ALSO"
68 .BR CURLOPT_SSLVERSION "(3), " CURLOPT_HTTP200ALIASES "(3), "