curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Ubiquiti

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 19 Apr 2017 00:07:34 +0200 (CEST)

On Tue, 18 Apr 2017, Greg Stewart via curl-library wrote:

> I got everything working. Below I have my code which needs to be cleaned up.
>
> Since I can't save the cookie file to the ESP32 in a file format, how do I
> store the cookie and reuse it? Can I put it in a buffer?

You probably don't need to store it. If you just enable cookies with
CURLOPT_COOKIEFILE and then reuse the same easy handle for the series of
requests, that handle will hold the cookies in memory and send the necessary
cookies in subsequent requests too.

You shouldn't cleanup/init the handle anyway since that also prevents
connection reuse and thus makes your code run slower and use more CPU
resources.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-04-19