18 #ifndef GAZEBO_PLUGINS_REST_WEB_RESTAPI_HH_
19 #define GAZEBO_PLUGINS_REST_WEB_RESTAPI_HH_
46 public: std::string
Login(
const std::string &_url,
47 const std::string &_route,
48 const std::string &_user,
49 const std::string &_pass);
59 public:
void PostJsonData(
const char *_route,
const char *_json);
63 public: std::string
GetUser()
const;
71 private: std::string Request(
const std::string &_requestUrl,
72 const std::string &_postStr);
75 private:
void SendUnpostedPosts();
78 private: std::string url;
81 private: std::string user;
84 private: std::string pass;
87 private: std::string loginRoute;
90 private:
bool isLoggedIn;
100 private: std::list<Post> posts;
103 private: std::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:32
virtual ~RestApi()
Destructor.
void PostJsonData(const char *_route, const char *_json)
Notify the service with a http POST.