24namespace network_manager
124 virtual
unsigned getHTTPCode () const noexcept = 0;
127 virtual
std::
string getErrorString () const = 0;
129 virtual
bool headersReceived () const noexcept = 0;
131 virtual
bool hasHeader (const
std::
string& headerName) const noexcept = 0;
132 virtual
std::
string getHeader (const
std::
string& headerName) const = 0;
137 virtual const
Request& getRequest () const noexcept = 0;
138 virtual
std::
string getURL () const = 0;
140 virtual
void abort () noexcept = 0;
151 virtual uint64_t getBytesAvailable () const noexcept = 0;
154 virtual uint64_t readData (
void* buffer, uint64_t maxBytesCount) = 0;
156 template<typename RetVal =
std::vector<uint8_t>>
161 constexpr uint64_t bufferSize = 4 * 1024;
162 uint8_t buffer[bufferSize];
164 while (uint64_t bytesRead = readData (buffer, bufferSize))
166 using PtrType =
typename RetVal::pointer;
168 PtrType
begin =
reinterpret_cast<PtrType
>(buffer);
169 PtrType
end =
reinterpret_cast<PtrType
>(buffer + bytesRead);
171 result.insert (result.end (),
begin,
end);
173 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
@ RequestHeaderFieldsTooLarge
@ HTTPVersionNotSupported
@ NonAuthoritativeInformation
@ NetworkAuthenticationRequired
const char * end(const char *str) noexcept
const char * begin(const char *str) noexcept