CURLOPT_EXPECT_100_TIMEOUT_MS(3)
π
CURLOPT_EXPECT_100_TIMEOUT_MS(3) β Library Functions Manual π
Okay bestie, welcome to the manual page for CURLOPT_EXPECT_100_TIMEOUT_MS(3) from the libcurl Library Functions Manual. We're talking timeout for the Expect: 100-continue response, and it's giving very specific main character energy: how long does libcurl wait before it stops waiting? Let's get into it. π¦
πΈ NAME πΈ
CURLOPT_EXPECT_100_TIMEOUT_MS β timeout for the Expect: 100-continue response. That's the name, that's the vibe, no notes. π
β¨ SYNOPSIS β¨
Copy this exactly, bestie β headers and signatures are sacred. π§
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_EXPECT_100_TIMEOUT_MS,
long milliseconds);
π¦ DESCRIPTION π¦
So you pass a long, and that's you telling libcurl the number of milliseconds to wait for a server response with HTTP status 100 (Continue), 417 (Expectation Failed), or similar. This is after sending an HTTP request that contains an Expect: 100-continue header. The way that timeout works? It's literally just a countdown for that response. β³
Now the important part: if this times out before a response is received, the request body is sent anyway. Not a drill. π So the body is not held hostage forever β it just gets sent without that wait. That's the behavior, periodt.
π DEFAULT π
The default is 1000 milliseconds. One whole second of waiting, periodt. π
π PROTOCOLS π
This functionality affects http only. That's it β only HTTP is invited to this party. π
π EXAMPLE π
Here's the example, and yes, it's exact:
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
/* wait 3 seconds for 100-continue */
curl_easy_setopt(curl, CURLOPT_EXPECT_100_TIMEOUT_MS, 3000L);
curl_easy_perform(curl);
}
}
See how it sets CURLOPT_EXPECT_100_TIMEOUT_MS to 3000L? That's three seconds of waiting for 100-continue, and the comment says it exactly. Obsessed with clarity. π
π AVAILABILITY π
Added in curl 7.36.0. So if you're on something older, this option is not in the group chat. π
π 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 whole lore drop. π
π₯ SEE ALSO π₯
CURLOPT_HTTPPOST(3)β go check it, bestie.CURLOPT_POST(3)β also on the reading list. π₯
π That's the whole page, bestie β this is the libcurl manual page dated 2026-10-12, and its footer files it under CURLOPT_EX..._TIMEOUT_MS(3). Slay, and happy waiting. π«Ά
π¦ 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