KiCad PCB EDA Suite
kicad_curl_easy.h File Reference
#include <functional>
#include <memory>
#include <ostream>
#include <string>

Go to the source code of this file.

Classes

class  KICAD_CURL_EASY
 

Typedefs

typedef void CURL
 
typedef std::function< int(size_t, size_t, size_t, size_t)> TRANSFER_CALLBACK
 Wrapper interface around the curl_easy API/. More...
 

Typedef Documentation

◆ CURL

typedef void CURL

Definition at line 41 of file kicad_curl_easy.h.

◆ TRANSFER_CALLBACK

typedef std::function<int( size_t, size_t, size_t, size_t )> TRANSFER_CALLBACK

Wrapper interface around the curl_easy API/.

Handling of using the curl_easy API to make a request and save the response to a memory buffer

Here is a small example usage:

curl.SetURL( "http://github.com" );
curl.SetUserAgent( <http-client-identifier> );
curl.SetHeader( "Accept", "application/json" );
curl.Perform();
int Perform()
Equivalent to curl_easy_perform.
bool SetUserAgent(const std::string &aAgent)
Set the request user agent.
void SetHeader(const std::string &aName, const std::string &aValue)
Set an arbitrary header for the HTTP(s) request.
bool SetURL(const std::string &aURL)
Set the request URL.

Definition at line 62 of file kicad_curl_easy.h.