curl_slist_append

Definition: include builtins\libcurl.e

atom slist = curl_slist_append(atom slist slist, string s)
Description: Add a string to an slist.

curl_slist_append appends a string to a linked list of strings.
The existing list should be passed as the first argument and the new list is returned from this function.
Pass in NULL in the list argument to create a new list.
The specified string has been appended when this function returns.
curl_slist_append copies the string.

The list should be freed again (after usage) with curl_slist_free_all.

Return value: A null pointer is returned if anything went wrong, otherwise the new list pointer is returned.
Example:
atom slist = curl_slist_append(NULL, "pragma:")
 if slist==NULL then return -1 end if
curl_easy_setopt(some_handle, CURLOPT_HTTPHEADER, slist)
curl_easy_perform(some_handle)
curl_slist_free_all(slist)
See Also: curl_slist_free_all