Switchboard SDK
Loading...
Searching...
No Matches
switchboard::NetworkSession Class Reference

Class for sending network requests. More...

#include <NetworkSession.hpp>

Public Member Functions

 NetworkSession ()
 
 ~NetworkSession ()
 
int makePostRequest (const std::string &url, const std::vector< std::string > &headers, const std::string &body, NetworkSessionCallback callback, void *userPointer)
 

Detailed Description

Class for sending network requests.

NetworkSession class.

Constructor & Destructor Documentation

◆ NetworkSession()

switchboard::NetworkSession::NetworkSession ( )

Initializes the network session.

◆ ~NetworkSession()

switchboard::NetworkSession::~NetworkSession ( )

Destructs the network session.

Member Function Documentation

◆ makePostRequest()

int switchboard::NetworkSession::makePostRequest ( const std::string & url,
const std::vector< std::string > & headers,
const std::string & body,
NetworkSessionCallback callback,
void * userPointer )

Makes a POST request.

Parameters
urlThe destination url.
headersThe headers for the request.
bodyThe body of the request.
callbackCallback function called with the id of the request
userPointerUser provided pointer that will be passed back in the callback function.
Returns
The id of the request, or 0 if the request could not be created.