#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP_VERSION, long version);
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS);
result = curl_easy_perform(curl);
if(result == CURLE_HTTP_RETURNED_ERROR) {
/* an HTTP response error problem */
}
}
}