1CURLOPT_HTTP200ALIASES(3)           libcurl          CURLOPT_HTTP200ALIASES(3)
2
3
4

NAME

6       CURLOPT_HTTP200ALIASES - alternative matches for HTTP 200 OK
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP200ALIASES,
12                                 struct curl_slist *aliases);
13

DESCRIPTION

15       Pass  a pointer to a linked list of aliases to be treated as valid HTTP
16       200 responses.  Some servers respond  with  a  custom  header  response
17       line.   For  example, SHOUTcast servers respond with "ICY 200 OK". Also
18       some old Icecast 1.3.x servers will respond like that for certain  user
19       agent  headers  or in absence of such. By including this string in your
20       list of aliases, the response will be treated as a  valid  HTTP  header
21       line such as "HTTP/1.0 200 OK".
22
23       The  linked  list  should  be  a  fully valid list of struct curl_slist
24       structs, and be properly filled in.  Use curl_slist_append(3) to create
25       the list and curl_slist_free_all(3) to clean up an entire list.
26
27       The alias itself is not parsed for any version strings. The protocol is
28       assumed to match HTTP 1.0 when an alias match.
29

DEFAULT

31       NULL
32

PROTOCOLS

34       HTTP
35

EXAMPLE

37       CURL *curl = curl_easy_init();
38       if(curl) {
39         struct curl_slist *list;
40         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
41
42         list = curl_slist_append(NULL, "ICY 200 OK");
43         list = curl_slist_append(list, "WEIRDO 99 FINE");
44
45         curl_easy_setopt(curl, CURLOPT_HTTP200ALIASES, list);
46         curl_easy_perform(curl);
47         curl_slist_free_all(list); /* free the list again */
48       }
49

AVAILABILITY

51       Added in 7.10.3
52

RETURN VALUE

54       Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not.
55

SEE ALSO

57       CURLOPT_HTTP_VERSION(3),
58
59
60
61ibcurl 8.2.1                    April 26, 2023       CURLOPT_HTTP200ALIASES(3)
Impressum