curl_easy_init

Syntax

#include <curl/curl.h>

CURL *curl_easy_init( );

Parameters

None.

Return Values

Handle to an easy CURL session. If this function returns NULL, an unexpected issue occurred and the other CURL functions cannot be used.

Description

This function must be the first function to call, and it returns a CURL easy handle that must be used as input to other easy-functions. curl_easy_init initializes curl and this call must have a corresponding call to curl_easy_cleanup when the operation is complete.

If curl_global_init was not already called, curl_easy_init does it automatically. This may be lethal in multithreaded cases, since curl_global_init is not thread-safe and it may result in resource issues because there is no corresponding cleanup. It is strongly advised to not allow this automatic behavior. This is accomplished by manually calling curl_global_init.

For information on how to use this function, see the description of global environment requirements in libcurl.

NOTE:
Cafe libcurl automatically applies system proxy settings on the CURL easy handle. For more information, see Proxy Settings.

Do Not Call From

None.

See Also

HTTP Client Library (libcurl)
libcurl API Functions
libcurl Error Codes
curl_easy_cleanup
curl_global_init
curl_easy_reset

Revision History

2013/09/18 Conversion
2013/05/08 Automated cleanup pass.
2012/05/04 Initial version.


CONFIDENTIAL