CURLOPT_HTTP200ALIASES.3 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .\" generated by cd2nroff 0.1 from CURLOPT_HTTP200ALIASES.md
  2. .TH CURLOPT_HTTP200ALIASES 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_HTTP200ALIASES \- alternative matches for HTTP 200 OK
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP200ALIASES,
  9. struct curl_slist *aliases);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a pointer to a linked list of \fIaliases\fP to be treated as valid HTTP 200
  13. responses. Some servers respond with a custom header response line. For
  14. example, SHOUTcast servers respond with "ICY 200 OK". Also some old Icecast
  15. 1.3.x servers respond like that for certain user agent headers or in absence
  16. of such. By including this string in your list of aliases, the response gets
  17. treated as a valid HTTP header line such as "HTTP/1.0 200 OK".
  18. The linked list should be a fully valid list of struct curl_slist structs, and
  19. be properly filled in. Use \fIcurl_slist_append(3)\fP to create the list and
  20. \fIcurl_slist_free_all(3)\fP to clean up an entire list.
  21. The alias itself is not parsed for any version strings. The protocol is
  22. assumed to match HTTP 1.0 when an alias match.
  23. .SH DEFAULT
  24. NULL
  25. .SH PROTOCOLS
  26. This functionality affects http only
  27. .SH EXAMPLE
  28. .nf
  29. int main(void)
  30. {
  31. CURL *curl = curl_easy_init();
  32. if(curl) {
  33. struct curl_slist *list;
  34. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  35. list = curl_slist_append(NULL, "ICY 200 OK");
  36. list = curl_slist_append(list, "WEIRDO 99 FINE");
  37. curl_easy_setopt(curl, CURLOPT_HTTP200ALIASES, list);
  38. curl_easy_perform(curl);
  39. curl_slist_free_all(list); /* free the list again */
  40. }
  41. }
  42. .fi
  43. .SH AVAILABILITY
  44. Added in curl 7.10.3
  45. .SH RETURN VALUE
  46. Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not.
  47. .SH SEE ALSO
  48. .BR CURLOPT_HTTP09_ALLOWED (3),
  49. .BR CURLOPT_HTTP_VERSION (3)