Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
API::Requests Class Reference

#include <Requests.h>

Classes

class  impl
 

Public Member Functions

 Requests ()
 
 ~Requests ()
 
 Requests (const Requests &)=delete
 
 Requests (Requests &&)=delete
 
Requestsoperator= (const Requests &)=delete
 
Requestsoperator= (Requests &&)=delete
 
ARK_API bool CreateGetRequest (const std::string &url, const std::function< void(bool, std::string)> &callback, std::vector< std::string > headers={})
 Creates an async GET Request that runs in another thread but calls the callback from the main thread.
 
ARK_API bool CreatePostRequest (const std::string &url, const std::function< void(bool, std::string)> &callback, const std::string &post_data, std::vector< std::string > headers={})
 Creates an async POST Request with application/x-www-form-urlencoded content type that runs in another thread but calls the callback from the main thread.
 
ARK_API bool CreatePostRequest (const std::string &url, const std::function< void(bool, std::string)> &callback, const std::string &post_data, const std::string &content_type, std::vector< std::string > headers={})
 Creates an async POST Request that runs in another thread but calls the callback from the main thread.
 
ARK_API bool CreatePostRequest (const std::string &url, const std::function< void(bool, std::string)> &callback, const std::vector< std::string > &post_ids, const std::vector< std::string > &post_data, std::vector< std::string > headers={})
 Creates an async POST Request that runs in another thread but calls the callback from the main thread.
 
ARK_API bool CreateDeleteRequest (const std::string &url, const std::function< void(bool, std::string)> &callback, std::vector< std::string > headers={})
 Creates an async DELETE Request that runs in another thread but calls the callback from the main thread.
 

Static Public Member Functions

static ARK_API RequestsGet ()
 

Private Attributes

std::unique_ptr< implpimpl
 

Detailed Description

Definition at line 10 of file Requests.h.

Constructor & Destructor Documentation

◆ Requests() [1/3]

API::Requests::Requests ( )

Definition at line 50 of file Requests.cpp.

◆ ~Requests()

API::Requests::~Requests ( )

Definition at line 61 of file Requests.cpp.

+ Here is the call graph for this function:

◆ Requests() [2/3]

API::Requests::Requests ( const Requests & )
delete

◆ Requests() [3/3]

API::Requests::Requests ( Requests && )
delete

Member Function Documentation

◆ CreateDeleteRequest()

bool API::Requests::CreateDeleteRequest ( const std::string & url,
const std::function< void(bool, std::string)> & callback,
std::vector< std::string > headers = {} )

Creates an async DELETE Request that runs in another thread but calls the callback from the main thread.

Parameters
requestURL
thecallback function, binds sucess(bool) and result(string), result is error code if request failed and the response otherwise
includedheaders

Definition at line 292 of file Requests.cpp.

+ Here is the call graph for this function:

◆ CreateGetRequest()

bool API::Requests::CreateGetRequest ( const std::string & url,
const std::function< void(bool, std::string)> & callback,
std::vector< std::string > headers = {} )

Creates an async GET Request that runs in another thread but calls the callback from the main thread.

Parameters
requestURL
thecallback function, binds sucess(bool) and result(string), result is error code if request failed and the response otherwise
includedheaders

Definition at line 129 of file Requests.cpp.

+ Here is the call graph for this function:

◆ CreatePostRequest() [1/3]

bool API::Requests::CreatePostRequest ( const std::string & url,
const std::function< void(bool, std::string)> & callback,
const std::string & post_data,
const std::string & content_type,
std::vector< std::string > headers = {} )

Creates an async POST Request that runs in another thread but calls the callback from the main thread.

Parameters
requestURL
thecallback function, binds sucess(bool) and result(string), result is error code if request failed and the response otherwise
datato post
contenttype
includedheaders

Definition at line 200 of file Requests.cpp.

+ Here is the call graph for this function:

◆ CreatePostRequest() [2/3]

bool API::Requests::CreatePostRequest ( const std::string & url,
const std::function< void(bool, std::string)> & callback,
const std::string & post_data,
std::vector< std::string > headers = {} )

Creates an async POST Request with application/x-www-form-urlencoded content type that runs in another thread but calls the callback from the main thread.

Parameters
requestURL
thecallback function, binds sucess(bool) and result(string), result is error code if request failed and the response otherwise
datato post
includedheaders

Definition at line 162 of file Requests.cpp.

+ Here is the call graph for this function:

◆ CreatePostRequest() [3/3]

bool API::Requests::CreatePostRequest ( const std::string & url,
const std::function< void(bool, std::string)> & callback,
const std::vector< std::string > & post_ids,
const std::vector< std::string > & post_data,
std::vector< std::string > headers = {} )

Creates an async POST Request that runs in another thread but calls the callback from the main thread.

Parameters
requestURL
thecallback function, binds sucess(bool) and result(string), result is error code if request failed and the response otherwise
datakey
datavalue
includedheaders

Definition at line 238 of file Requests.cpp.

+ Here is the call graph for this function:

◆ Get()

Requests & API::Requests::Get ( )
static

Definition at line 67 of file Requests.cpp.

◆ operator=() [1/2]

Requests & API::Requests::operator= ( const Requests & )
delete

◆ operator=() [2/2]

Requests & API::Requests::operator= ( Requests && )
delete

Member Data Documentation

◆ pimpl

std::unique_ptr<impl> API::Requests::pimpl
private

Definition at line 84 of file Requests.h.


The documentation for this class was generated from the following files: