CURLOPT_KEEP_SENDING_ON_ERROR(3)
π CURLOPT_KEEP_SENDING_ON_ERROR(3) β¨
okay bestie, welcome to the Library Functions Manual page for CURLOPT_KEEP_SENDING_ON_ERROR(3) β yes the title is a whole mouthful, we love her anyway π«Ά
πΈ NAME πΈ
CURLOPT_KEEP_SENDING_ON_ERROR β keep sending on early HTTP response >= 300 π
β SYNOPSIS β
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_KEEP_SENDING_ON_ERROR,
long keep_sending);
π¦ DESCRIPTION π¦
So here's the vibe: you set this long parameter to 1, and you're literally telling the library "bestie, keep sending the request body even if the HTTP code that came back is equal to or larger than 300." The default behavior is the opposite β it stops sending and closes the stream or connection. π
This option is suitable for manual NTLM authentication, i.e. if an application does not use CURLOPT_HTTPAUTH(3), but instead sets "Authorization: NTLM ..." headers manually using CURLOPT_HTTPHEADER(3). iykyk π
Most applications do not need this option. fr fr, like, most of y'all can scroll past. π
π DEFAULT π
0, stop sending on error π
π PROTOCOLS π
This functionality affects http only β¨
π₯ EXAMPLE π₯
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "sending data");
curl_easy_setopt(curl, CURLOPT_KEEP_SENDING_ON_ERROR, 1L);
result = curl_easy_perform(curl);
}
}
look at her go, main character energy honestly π
π AVAILABILITY π
Added in curl 7.51.0 β she's been iconic since day one, periodt π
π«Ά 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). π
π§ SEE ALSO π§
libcurl Β· 2026-10-12 Β· CURLOPT_KEEP_SENDING_ON_ERROR(3) β mwah, that's the page, go slay your HTTP requests bestie π
ππ
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms