quickjs-tart

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

CURLOPT_KEEP_SENDING_ON_ERROR.md (1605B)


      1 ---
      2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
      3 SPDX-License-Identifier: curl
      4 Title: CURLOPT_KEEP_SENDING_ON_ERROR
      5 Section: 3
      6 Source: libcurl
      7 See-also:
      8   - CURLINFO_RESPONSE_CODE (3)
      9   - CURLOPT_FAILONERROR (3)
     10   - CURLOPT_HTTPHEADER (3)
     11 Protocol:
     12   - HTTP
     13 Added-in: 7.51.0
     14 ---
     15 
     16 # NAME
     17 
     18 CURLOPT_KEEP_SENDING_ON_ERROR - keep sending on early HTTP response \>= 300
     19 
     20 # SYNOPSIS
     21 
     22 ~~~c
     23 #include <curl/curl.h>
     24 
     25 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_KEEP_SENDING_ON_ERROR,
     26                           long keep_sending);
     27 ~~~
     28 
     29 # DESCRIPTION
     30 
     31 A long parameter set to 1 tells the library to keep sending the request body
     32 if the HTTP code returned is equal to or larger than 300. The default action
     33 would be to stop sending and close the stream or connection.
     34 
     35 This option is suitable for manual NTLM authentication, i.e. if an application
     36 does not use CURLOPT_HTTPAUTH(3), but instead sets "Authorization: NTLM ..."
     37 headers manually using CURLOPT_HTTPHEADER(3).
     38 
     39 Most applications do not need this option.
     40 
     41 # DEFAULT
     42 
     43 0, stop sending on error
     44 
     45 # %PROTOCOLS%
     46 
     47 # EXAMPLE
     48 
     49 ~~~c
     50 int main(void)
     51 {
     52   CURL *curl = curl_easy_init();
     53   if(curl) {
     54     CURLcode ret;
     55     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
     56     curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "sending data");
     57     curl_easy_setopt(curl, CURLOPT_KEEP_SENDING_ON_ERROR, 1L);
     58     ret = curl_easy_perform(curl);
     59   }
     60 }
     61 ~~~
     62 
     63 # %AVAILABILITY%
     64 
     65 # RETURN VALUE
     66 
     67 curl_easy_setopt(3) returns a CURLcode indicating success or error.
     68 
     69 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
     70 libcurl-errors(3).