Sortix nightly manual
This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
CURLOPT_COOKIE(3) | Library Functions Manual | CURLOPT_COOKIE(3) |
NAME
CURLOPT_COOKIE - HTTP Cookie headerSYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_COOKIE, char *cookie);
DESCRIPTION
Pass a pointer to a null-terminated string as parameter. It is used to set one or more cookies in the HTTP request. The format of the string should be NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie should contain.DEFAULT
NULL, no cookiesPROTOCOLS
This functionality affects http onlyEXAMPLE
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
curl_easy_setopt(curl, CURLOPT_COOKIE, "tool=curl; fun=yes;");
curl_easy_perform(curl);
}
}
AVAILABILITY
Added in curl 7.1RETURN VALUE
Returns CURLE_OK if HTTP is enabled, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space.SEE ALSO
CURLINFO_COOKIELIST(3), CURLOPT_COOKIEFILE(3), CURLOPT_COOKIEJAR(3), CURLOPT_COOKIELIST(3), CURLOPT_HTTPHEADER(3)2024-11-21 | libcurl |