Classes | Public Member Functions | List of all members
gazebo::RestApi Class Reference

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...
 

Detailed Description

REST interface.

Constructor & Destructor Documentation

gazebo::RestApi::RestApi ( )

Constructor.

virtual gazebo::RestApi::~RestApi ( )
virtual

Destructor.

Member Function Documentation

std::string gazebo::RestApi::GetUser ( ) const

Returns the username.

Returns
The user name
std::string gazebo::RestApi::Login ( const std::string &  _url,
const std::string &  _route,
const std::string &  _user,
const std::string &  _pass 
)

Connects to the REST service.

Parameters
[in]_urlThe web service url
[in]_routeThe route on the server
[in]_userThe user name
[in]_passThe user password
Returns
The response message from the REST server
void gazebo::RestApi::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 gazebo::RestApi::PostJsonData ( const char *  _route,
const char *  _json 
)

Notify the service with a http POST.

Parameters
[in]_routeon the web server
[in]_jsonthe data to send to the server

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