quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

CURLOPT_EXPECT_100_TIMEOUT_MS.md (1367B)


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