22namespace network_manager
61 virtual
unsigned getHTTPCode () const noexcept = 0;
64 virtual
std::
string getErrorString () const = 0;
66 virtual
bool headersReceived () const noexcept = 0;
68 virtual
bool hasHeader (const
std::
string& headerName) const noexcept = 0;
69 virtual
std::
string getHeader (const
std::
string& headerName) const = 0;
74 virtual const
Request& getRequest () const noexcept = 0;
75 virtual
std::
string getURL () const = 0;
77 virtual
void abort () noexcept = 0;
88 virtual uint64_t getBytesAvailable () const noexcept = 0;
91 virtual uint64_t readData (
void* buffer, uint64_t maxBytesCount) = 0;
93 template<typename RetVal =
std::vector<uint8_t>>
98 constexpr uint64_t bufferSize = 4 * 1024;
99 uint8_t buffer[bufferSize];
101 while (uint64_t bytesRead = readData (buffer, bufferSize))
103 using PtrType =
typename RetVal::pointer;
105 PtrType
begin =
reinterpret_cast<PtrType
>(buffer);
106 PtrType
end =
reinterpret_cast<PtrType
>(buffer + bytesRead);
108 result.insert (result.end (),
begin,
end);
110 if (bytesRead < bufferSize)
Declare macros for the Network Manager library DLL API.
#define NETWORK_MANAGER_API
A class, representing a list of HTTP cookies.
Class to construct the HTTP request.
Interface, that provides access to the data from the HTTP response.
virtual ~IResponse()=default
std::function< void(int64_t current, int64_t expected)> ProgressCallback
virtual bool isFinished() const noexcept=0
std::function< void(IResponse *)> RequestCallback
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
auto begin(const Ptr< Type, BaseDeleter > &p)
Enables range-for.