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 πŸ”₯


πŸ’– 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