12 #ifndef NETWORK_CORE_HTTP_H
13 #define NETWORK_CORE_HTTP_H
17 constexpr
int HTTP_429_TOO_MANY_REQUESTS = 429;
33 virtual void OnReceiveData(std::unique_ptr<
char[]> data,
size_t length) = 0;
58 static void Connect(
const std::string &uri,
HTTPCallback *callback,
const std::string data =
"");
Base socket handler for HTTP traffic.
static void Connect(const std::string &uri, HTTPCallback *callback, const std::string data="")
Connect to the given URI.
static void HTTPReceive()
Do the receiving for all HTTP connections.
void NetworkHTTPInitialize()
Initialize the HTTP socket handler.
void NetworkHTTPUninitialize()
Uninitialize the HTTP socket handler.
Callback for when the HTTP handler has something to tell us.
virtual bool IsCancelled() const =0
Check if there is a request to cancel the transfer.
virtual ~HTTPCallback()=default
Silentium.
virtual void OnFailure()=0
An error has occurred and the connection has been closed.
virtual void OnReceiveData(std::unique_ptr< char[]> data, size_t length)=0
We're receiving data.
Basic functions to receive and send TCP packets.