11 #ifndef INCLUDED_LIBCYBERRADIO_HTTPSSESSION_H_ 12 #define INCLUDED_LIBCYBERRADIO_HTTPSSESSION_H_ 14 #include "LibCyberRadio/Common/Debuggable.h" 15 #include <curl/curl.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 CURLcode initializeRequest()
Initializes the session object to handle a new request.
virtual long getResponseCode() const
Gets the HTTPS response code from the last request.
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 size_t writeResponseData(char *ptr, size_t size)
Write data into the response buffer.
virtual std::string getResponseHeader() const
Gets the HTTPS header from the last request.
virtual ~HttpsSession()
Destroys an HttpsSession object.
Class that supports debug output.
virtual int debug(const char *format,...)
Outputs debug information.
virtual std::string getResponseBody() const
Gets the HTTPS response body from the last request.
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...
Defines functionality for LibCyberRadio applications.
virtual size_t writeHeader(char *ptr, size_t size)
Write data into the header buffer.
HttpsSession(bool debug=false)
Constructs an HttpsSession object.
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.
Class that encapsulates an HTTPS session.
virtual const char * debugCurl(CURLcode x)
Returns a string corresponding to a libcurl error code.
virtual std::string getLastRequestErrorInfo() const
Gets the error information for the last request.