Net API
Overview
HTTP
WebSocket
Supported URL Schemes
Type
Schemes
HTTP API
bool net_http_get(...)
bool net_http_get(...)Parameters
Name
Type
Description
Returns
Example
bool net_http_post(...)
bool net_http_post(...)Example
WebSocket API
ws_t ws_connect(...)
ws_t ws_connect(...)Return value
Example
WebSocket Methods
bool ws_t::is_open() const
bool ws_t::is_open() constbool ws_t::send_text(const string &in msg)
bool ws_t::send_text(const string &in msg)bool ws_t::send_json(const string &in json)
bool ws_t::send_json(const string &in json)bool ws_t::send_binary(const array<uint8> &in data)
bool ws_t::send_binary(const array<uint8> &in data)Receiving Messages
bool ws_t::recv(string &out msg, bool &out is_text)
bool ws_t::recv(string &out msg, bool &out is_text)Example
bool ws_t::poll(string &out msg, bool &out is_text, bool &out is_closed)
bool ws_t::poll(string &out msg, bool &out is_text, bool &out is_closed)Outcomes
Example (frame update)
Closing
void ws_t::close(uint16 code = 1000)
void ws_t::close(uint16 code = 1000)Example
Automatic Cleanup (Important)
Full Example
Summary
HTTP
WebSocket
Last updated