18 #ifndef _GAZEBO_REST_API_HH_
19 #define _GAZEBO_REST_API_HH_
45 public: std::string
Login(
const std::string &_url,
46 const std::string &_route,
47 const std::string &_user,
48 const std::string &_pass);
58 public:
void PostJsonData(
const char *_route,
const char *_json);
62 public: std::string
GetUser()
const;
70 private: std::string Request(
const std::string &_requestUrl,
71 const std::string &_postStr);
74 private:
void SendUnpostedPosts();
77 private: std::string url;
80 private: std::string user;
83 private: std::string pass;
86 private: std::string loginRoute;
89 private:
bool isLoggedIn;
99 private: std::list<Post> posts;
102 private: boost::mutex postsMutex;
std::string Login(const std::string &_url, const std::string &_route, const std::string &_user, const std::string &_pass)
Connects to the REST service.
void Logout()
Stops sending messages to the REST service.
std::string GetUser() const
Returns the username.
REST interface.
Definition: RestApi.hh:31
virtual ~RestApi()
Destructor.
void PostJsonData(const char *_route, const char *_json)
Notify the service with a http POST.