11#ifndef INCLUDED_LIBCYBERRADIO_HTTPSSESSION_H_
12#define INCLUDED_LIBCYBERRADIO_HTTPSSESSION_H_
14#include "LibCyberRadio/Common/Debuggable.h"
52 const std::string& url,
67 const std::string& url,
70 const char* contentType =
"text/plain",
172 std::ostringstream _header;
174 std::ostringstream _response;
176 std::string _lastReqErrInfo;
virtual int debug(const char *format,...)
Outputs debug information.
Debuggable(bool debug=false, const std::string &debug_name="", FILE *debug_fp=DEBUG_FP, const std::string &debug_timefmt=DEBUG_TIME_FMT)
Constructs a Debuggable object.
static size_t writeDataCallback(char *ptr, size_t size, size_t nmemb, void *userdata)
Callback function that libcurl "writes" data to when retrieving an HTTPS response body.
virtual ~HttpsSession()
Destroys an HttpsSession object.
static size_t headerCallback(char *buffer, size_t size, size_t nitems, void *userdata)
Callback function that libcurl "writes" data to when retrieving an HTTPS response header.
virtual bool post(const std::string &url, void *data, size_t length, const char *contentType="text/plain", bool verify=true)
Posts data to a given URL over HTTPS.
virtual long getResponseCode() const
Gets the HTTPS response code from the last request.
virtual size_t writeResponseData(char *ptr, size_t size)
Write data into the response buffer.
virtual std::string getLastRequestErrorInfo() const
Gets the error information for the last request.
virtual bool get(const std::string &url, bool verify=true)
Gets data from a given URL over HTTPS.
virtual std::string getResponseBody() const
Gets the HTTPS response body from the last request.
virtual std::string getResponseHeader() const
Gets the HTTPS header from the last request.
virtual size_t writeHeader(char *ptr, size_t size)
Write data into the header buffer.
virtual CURLcode initializeRequest()
Initializes the session object to handle a new request.
HttpsSession(bool debug=false)
Constructs an HttpsSession object.
virtual const char * debugCurl(CURLcode x)
Returns a string corresponding to a libcurl error code.
Defines functionality for LibCyberRadio applications.