REST interface. More...
#include <RestApi.hh>
Public Member Functions | |
RestApi () | |
Constructor. More... | |
virtual | ~RestApi () |
Destructor. More... | |
std::string | GetUser () const |
Returns the username. More... | |
std::string | Login (const std::string &_url, const std::string &_route, const std::string &_user, const std::string &_pass) |
Connects to the REST service. More... | |
void | Logout () |
Stops sending messages to the REST service. More... | |
void | PostJsonData (const char *_route, const char *_json) |
Notify the service with a http POST. More... | |
REST interface.
RestApi | ( | ) |
Constructor.
|
virtual |
Destructor.
std::string GetUser | ( | ) | const |
Returns the username.
std::string Login | ( | const std::string & | _url, |
const std::string & | _route, | ||
const std::string & | _user, | ||
const std::string & | _pass | ||
) |
Connects to the REST service.
[in] | _url | The web service url |
[in] | _route | The route on the server |
[in] | _user | The user name |
[in] | _pass | The user password |
void Logout | ( | ) |
Stops sending messages to the REST service.
Does not do anything if not logged in. Once logged out, a new call to Login has to be made to resume sending messages.
void PostJsonData | ( | const char * | _route, |
const char * | _json | ||
) |
Notify the service with a http POST.
[in] | _route | on the web server |
[in] | _json | the data to send to the server |