GNURLOPT_HTTP200ALIASES(3)
π CURLOPT_HTTP200ALIASES π
okay bestie, this is the GNURLOPT_HTTP200ALIASES(3) manual page, and we're learning how to tell libcurl/gnurl that some weird little response line is actually a valid HTTP 200 OK. no cap, it's a whole vibe. π
π NAME π
CURLOPT_HTTP200ALIASES β specify alternative matches for HTTP 200 OK
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP200ALIASES,
struct curl_slist *aliases);
π¦ DESCRIPTION π¦
okay so you pass a pointer to a linked list of aliases, and each one gets treated like a valid HTTP 200 response. some servers are quirky and send a custom header response line. for example, SHOUTcast servers hit you with "ICY 200 OK". also some very old Icecast 1.3.x servers will respond like that for certain user agent headers or when there's no user agent header at all. by including this string in your list of aliases, the response is treated as a valid HTTP header line like "HTTP/1.0 200 OK". iconic, honestly. π«Ά
The linked list should be a fully valid list of struct curl_slist structs, and it needs to be properly filled in. use curl_slist_append(3) to create the list and curl_slist_free_all(3) to clean up an entire list. don't skip the cleanup, bestie β that's main character energy. π§Ήβ¨
The alias itself is not parsed for any version strings. when an alias matches, the protocol is assumed to match HTTP 1.0. periodt. π
π DEFAULT π
NULL
πΈ PROTOCOLS πΈ
HTTP
π₯ EXAMPLE π₯
CURL *curl = curl_easy_init();
if(curl) {
struct curl_slist *list;
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
list = curl_slist_append(NULL, "ICY 200 OK");
list = curl_slist_append(list, "WEIRDO 99 FINE");
curl_easy_setopt(curl, CURLOPT_HTTP200ALIASES, list);
curl_easy_perform(curl);
curl_slist_free_all(list); /* free the list again */
}
β AVAILABILITY β
Added in 7.10.3. she's been around. π
π RETURN VALUE π
Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not.
π SEE ALSO π
okay bestie, that's the whole page. this icon was brought to you by libcurl 7.37.0, dated 17 Jun 2014, and yes the manual name is GNURLOPT_HTTP200ALIASES(3). mwah πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms