1CURLOPT_HTTP200ALIASES(3) curl_easy_setopt options CURLOPT_HTTP200ALIASES(3)
2
3
4
6 CURLOPT_HTTP200ALIASES - specify alternative matches for HTTP 200 OK
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP200ALIASES,
12 struct curl_slist *aliases);
13
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 very old Icecast 1.3.x servers will respond like that for certain
19 user agent headers or in absence of such. By including this string in
20 your list of aliases, the response will be treated as a valid HTTP
21 header 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
31 NULL
32
34 HTTP
35
37 CURL *curl = curl_easy_init();
38 if(curl) {
39 struct curl_slist *list;
40 curl_easy_setopt(curl, CURLOPT_URL, "http://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
51 Added in 7.10.3
52
54 Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not.
55
57 CURLOPT_HTTP_VERSION(3),
58
59
60
61libcurl 7.71.1 May 31, 2017 CURLOPT_HTTP200ALIASES(3)