17#include "../IResponse.h"
19#include "../HeadersList.h"
20#include "../CookiesList.h"
21#include "../Request.h"
27namespace network_manager
32class RequestPayloadStream;
50 bool hasHeader(
const std::string& headerName)
const noexcept override;
51 std::string
getHeader(
const std::string& headerName)
const override;
58 std::string
getURL()
const override;
60 void abort()
noexcept override;
72 uint64_t
readData(
void* buffer, uint64_t maxBytesCount)
override;
75 void setForm(std::unique_ptr<MultipartData> form);
108 std::unique_ptr<MultipartData>
mForm;
Declare a class responsible for reuse of CURL handles.
std::deque< uint8_t > mDataBuffer
virtual void setUploadProgressCallback(ProgressCallback callback) override
Set the upload progress callback.
void setForm(std::unique_ptr< MultipartData > form)
HeadersList mResponseHeaders
virtual void setDownloadProgressCallback(ProgressCallback callback) override
Set the download progress callback.
static size_t WriteCallback(const uint8_t *ptr, size_t size, size_t nmemb, CurlResponse *userdata) noexcept
uint64_t getBytesAvailable() const noexcept override
const CookiesList & getCookies() const noexcept override
std::unique_ptr< MultipartData > mForm
NetworkError getError() const noexcept override
void setPayload(RequestPayloadStreamPtr payload)
const Request & getRequest() const noexcept override
static int CurlProgressCallback(CurlResponse *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) noexcept
bool isFinished() const noexcept override
CurlHandleManager * mHandleManager
void setOnDataReceivedCallback(RequestCallback callback) override
std::mutex mDataBufferMutex
NetworkError mNetworkError
unsigned getHTTPCode() const noexcept override
CurlResponse(RequestVerb verb, const Request &request, CurlHandleManager *handleManager) noexcept
ProgressCallback mUploadProgressCallback
std::recursive_mutex mStatusMutex
std::mutex mCallbackMutex
std::string getErrorString() const override
bool hasHeader(const std::string &headerName) const noexcept override
std::string getHeader(const std::string &headerName) const override
const HeadersList & getHeaders() const noexcept override
static size_t HeaderCallback(const char *buffer, size_t size, size_t nitems, CurlResponse *userdata) noexcept
CurlHandleManager::Handle * mCurrentHandle
RequestCallback mRequestFinishedCallback
ProgressCallback mDownloadProgressCallback
void setRequestFinishedCallback(RequestCallback callback) override
void abort() noexcept override
uint64_t readData(void *buffer, uint64_t maxBytesCount) override
RequestCallback mOnDataReceivedCallback
CookiesList mResponseCookies
RequestPayloadStreamPtr mPayload
bool headersReceived() const noexcept override
std::string getURL() const override
Interface, that provides access to the data from the HTTP response.
std::function< void(int64_t current, int64_t expected)> ProgressCallback
std::function< void(IResponse *)> RequestCallback
std::shared_ptr< RequestPayloadStream > RequestPayloadStreamPtr