Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
CURL.SetOptionHTTPVersion
Sets which HTTP version is used.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
CURL | 2.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "CURL.SetOptionHTTPVersion"; curl; Value ) More
Parameters
Parameter | Description | Example |
---|---|---|
curl | The CURL session handle. | $curl |
Value | Sets the HTTP Version. | 2 |
Result
Returns "OK" on success.
Description
Sets which HTTP version is used.This is not sensible to do unless you have a good reason.
CURL_HTTP_VERSION_NONE | 0 | We don't care about what version the library uses. libcurl will use whatever it thinks fit. |
CURL_HTTP_VERSION_1_0 | 1 | Enforce HTTP 1.0 requests. |
CURL_HTTP_VERSION_1_1 | 2 | Enforce HTTP 1.1 requests. |
CURL_HTTP_VERSION_2_0 | 3 | please use HTTP 2 in the request |
CURL_HTTP_VERSION_2TLS | 4 | use version 2 for HTTPS, version 1.1 for HTTP |
CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE | 5 | please use HTTP 2 without HTTP/1.1 Upgrade |
See also HTTP_VERSION option in CURL manual.
See also
- CURL.GetOptionHTTPHeader
- CURL.SetOptionCustomRequest
- CURL.SetOptionHTTP200Aliases
- CURL.SetOptionHTTPHeader
- CURL.SetOptionProxyType
- CURL.SetOptionRTSPSessionID
- CURL.SetOptionSSLVersion
Created 18th August 2014, last changed 29th April 2017
CURL.SetOptionHTTPTransferDecoding - CURL.SetOptionHappyEyeballsTimeOutMS