KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kicad_curl_easy.h File Reference
#include <kicommon.h>
#include <functional>
#include <memory>
#include <ostream>
#include <string>
#include <cstdint>

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/.
 

Typedef Documentation

◆ CURL

typedef void CURL

Definition at line 43 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 64 of file kicad_curl_easy.h.