CURLOPT_HTTP200ALIASES(3)
π CURLOPT_HTTP200ALIASES(3) β the curl library functions manual, bestie edition π
ok so this page lives in the libcurl manual (section 3, the library-functions girlies β¨) and it's literally all about CURLOPT_HTTP200ALIASES. Let's get into it π¦
β¨ NAME β¨
CURLOPT_HTTP200ALIASES β alternative matches for HTTP 200 OK π
πΈ SYNOPSIS πΈ
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP200ALIASES,
struct curl_slist *aliases);
π DESCRIPTION π
okay so picture this: you pass in a pointer to a linked list of aliases β like, strings that libcurl should treat as totally valid HTTP 200 responses. no cap. why? because some servers are extra and respond with a custom header response line instead of the standard one π«
the iconic example: SHOUTcast servers respond with "ICY 200 OK". also some old Icecast 1.3.x servers pull that same move for certain user agent headers, or when there's no such header at all. rude but okay π
by including that string in your list of aliases, the response gets treated like a valid HTTP header line β like "HTTP/1.0 200 OK". slay β¨
the linked list should be a fully valid list of struct curl_slist structs, and properly filled in, bestie. use curl_slist_append(3) to build the list and curl_slist_free_all(3) to clean up an entire list when you're done π§Ή
β οΈ heads up: the alias itself is not parsed for any version strings. the protocol is assumed to match HTTP 1.0 when an alias match happens. so don't go expecting version detection magic, iykyk.
using this option multiple times makes the last set list override the previous ones (last one wins, main character energy π). set it to NULL to disable its use again.
π₯ and this is the important one: libcurl does not copy the list. it needs to be kept around until after the transfer has completed. fr fr, don't free it early or it's giving undefined chaos π
π DEFAULT π
NULL
π PROTOCOLS π
this functionality affects http only π
β EXAMPLE β
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
struct curl_slist *list;
curl_easy_setopt(curl, CURLOPT_URL, "https://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 */
}
}
look at that list getting built and then freed again at the end β responsible queen behavior π
π¦ AVAILABILITY π¦
added in curl 7.10.3 β vintage but still iconic β¨
π RETURN VALUE π
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK π₯³, non-zero means an error occurred π β see libcurl-errors(3) for the full tea.
π SEE ALSO π
and that's the whole page babes π«Ά β brought to you by libcurl, dated 2026-10-12, page CURLOPT_HTTP200ALIASES(3), signing off πβ¨
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms