• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_EXPECT_100_TIMEOUT_MS
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_HTTPPOST (3)
9  - CURLOPT_POST (3)
10---
11
12# NAME
13
14CURLOPT_EXPECT_100_TIMEOUT_MS - timeout for Expect: 100-continue response
15
16# SYNOPSIS
17
18~~~c
19#include <curl/curl.h>
20
21CURLcode curl_easy_setopt(CURL *handle, CURLOPT_EXPECT_100_TIMEOUT_MS,
22                          long milliseconds);
23~~~
24
25# DESCRIPTION
26
27Pass a long to tell libcurl the number of *milliseconds* to wait for a
28server response with the HTTP status 100 (Continue), 417 (Expectation Failed)
29or similar after sending an HTTP request containing an Expect: 100-continue
30header. If this times out before a response is received, the request body is
31sent anyway.
32
33# DEFAULT
34
351000 milliseconds
36
37# PROTOCOLS
38
39HTTP
40
41# EXAMPLE
42
43~~~c
44int main(void)
45{
46  CURL *curl = curl_easy_init();
47  if(curl) {
48    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
49
50    /* wait 3 seconds for 100-continue */
51    curl_easy_setopt(curl, CURLOPT_EXPECT_100_TIMEOUT_MS, 3000L);
52
53    curl_easy_perform(curl);
54  }
55}
56~~~
57
58# AVAILABILITY
59
60Added in 7.36.0
61
62# RETURN VALUE
63
64Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
65