Imported Upstream version 7.44.0
[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 http://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
32 force libcurl to use the specific HTTP versions. This is not sensible to do
33 unless you have a good reason. You have to set this option if you want to use
34 libcurl's HTTP/2 support.
35
36 .IP CURL_HTTP_VERSION_NONE
37 We don't care about what version the library uses. libcurl will use whatever
38 it thinks fit.
39 .IP CURL_HTTP_VERSION_1_0
40 Enforce HTTP 1.0 requests.
41 .IP CURL_HTTP_VERSION_1_1
42 Enforce HTTP 1.1 requests.
43 .IP CURL_HTTP_VERSION_2_0
44 Attempt HTTP 2 requests. libcurl will fall back to HTTP 1.x if HTTP 2 can't be
45 negotiated with the server. (Added in 7.33.0)
46 .SH DEFAULT
47 CURL_HTTP_VERSION_NONE
48 .SH PROTOCOLS
49 HTTP
50 .SH EXAMPLE
51 TODO
52 .SH AVAILABILITY
53 Along with HTTP
54 .SH RETURN VALUE
55 Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not.
56 .SH "SEE ALSO"
57 .BR CURLOPT_SSLVERSION "(3), " CURLOPT_HTTP200ALIASES "(3), "