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