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, will not be copied by the library.Instead you should keep
them available until libcurl no longer needs them. Failing to do so will cause very odd behavior or even
crashes. libcurl will need them until you call curl_easy_cleanup(3) or you set the same option again to use
adifferent pointer.
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 non-zero 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.
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
Anon-zero parameter tells the library to include the header in the body output. This is only rele-
vant for protocols that actually have headers preceding the data (likeHTTP).
CURLOPT_NOPROGRESS
Anon-zero parameter tells the library to shut offthe built-in progress meter completely.
Future versions of libcurl is likely to not have any built-in progress meter at all.
CURLOPT_NOSIGNAL
Pass a long. If it is non-zero, libcurl will not use anyfunctions that install signal handlers or any
functions 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.
(Added in 7.10)
Consider building libcurl with ares support to enable asynchronous DNS lookups. It enables nice
timeouts for name resolves without signals.
CALLBACKOPTIONS
libcurl 7.14.2 22 Sep 2005 1