10#ifndef NETWORK_CORE_HTTP_H
11#define NETWORK_CORE_HTTP_H
31 virtual void OnReceiveData(std::unique_ptr<
char[]> data,
size_t length) = 0;
Base socket handler for HTTP traffic.
static void Connect(std::string_view uri, HTTPCallback *callback, 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.
constexpr int HTTP_429_TOO_MANY_REQUESTS
HTTP error code for when the client is doing too many requests.
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
Ensure the destructor of the sub classes are called as well.
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.