woooeeeww now i can include a User-Agent header

i thought that the libcurl in c is way to messy with large named functions but now i feel  ‘It isn’t that messy after all’

and guess what, now  can include a http header with


{
     struct curl_slist *headers = NULL;
     headers = curl_slist_append(headers, "User-Agent: gistthis");
     curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
}

and i think making blocks for each of them is a good practice to reduce the scope of struct curl_slist . blocks is better than using functions.
and there’s no reason to curl_slist_free_all() before we exit.

I think freeing the memory (of-course before the exit) is one of the cause of global warming.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s