curl_easy_setopt(3) libcurl Manual curl_easy_setopt(3)
NAME
curl_easy_setopt − set options for a curl easy handle
SYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLoption option, parameter);
DESCRIPTION
curl_easy_setopt() is used to tell libcurl howtobehave.Byusing the appropriate options to
curl_easy_setopt,you can change libcurl’sbehavior.All options are set with the option followed by a
parameter.That parameter can be a long,afunction pointer,an object pointer or a curl_off_t,depending
on what the specific option expects. Read this manual carefully as bad input values may cause libcurl to
behave badly! You can only set one option in each function call. A typical application uses many
curl_easy_setopt() calls in the setup phase.
Options set with this function call are valid for all forthcoming transfers performed using this handle.The
options are not in anyway reset between transfers, so if you want subsequent transfers with different
options, you must change them between the transfers. You can optionally reset all options back to internal
default with curl_easy_reset(3).
Strings passed to libcurl as ’char *’ arguments, are copied by the library; thus the string storage associated
to the pointer argument may be overwritten after curl_easy_setopt() returns. Exceptions to this rule are
described in the option details below.
Before version 7.17.0, strings were not copied. Instead the user was forced keep them available until libcurl
no longer needed them.
The handle is the return code from a curl_easy_init(3) or curl_easy_duphandle(3) call.
BEHAVIOR OPTIONS
CURLOPT_VERBOSE
Set the parameter to 1 to get the library to display a lot of verbose information about its operations.
Very useful for libcurl and/or protocol debugging and understanding. The verbose information will
be sent to stderr,orthe stream set with CURLOPT_STDERR.The default value for this parameter
is 0.
Youhardly everwant this set in production use, you will almost always want this when you
debug/report problems. Another neat option for debugging is the CURLOPT_DEBUGFUNCTION.
CURLOPT_HEADER
Aparameter set to 1 tells the library to include the header in the body output. This is only relevant
for protocols that actually have headers preceding the data (likeHTTP). The default value for this
parameter is 0.
CURLOPT_NOPROGRESS
Pass a long. If set to 1, it tells the library to shut offthe progress meter completely.Itwill also pre-
vent the CURLOPT_PROGRESSFUNCTION from getting called. The default value for this
parameter is 1.
Future versions of libcurl are likely to not have any built-in progress meter at all.
CURLOPT_NOSIGNAL
Pass a long. If it is 1, libcurl will not use anyfunctions that install signal handlers or anyfunctions
that cause signals to be sent to the process. This option is mainly here to allowmulti-threaded unix
applications to still set/use all timeout options etc, without risking getting signals. The default
value for this parameter is 0. (Added in 7.10)
libcurl 7.20.0 1Jan 2010 1