Simple GET request works.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
tastytea 2020-01-04 19:05:18 +01:00
parent 0b525bb748
commit cac3e0b505
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 5 additions and 5 deletions

View File

@ -57,7 +57,7 @@ public:
* @since 0.1.0 * @since 0.1.0
*/ */
[[nodiscard]] [[nodiscard]]
answer_type get(API::endpoint_type endpoint) const; answer_type get(API::endpoint_type endpoint);
/*! /*!
* @brief Make a HTTP GET call. * @brief Make a HTTP GET call.
@ -67,7 +67,7 @@ public:
* @since 0.1.0 * @since 0.1.0
*/ */
[[nodiscard]] [[nodiscard]]
answer_type get(string endpoint) const; answer_type get(string endpoint);
private: private:
Instance &_instance; Instance &_instance;

View File

@ -23,17 +23,17 @@ Request::Request(Instance &instance)
: _instance{instance} : _instance{instance}
{} {}
answer_type Request::get(API::endpoint_type endpoint) const answer_type Request::get(API::endpoint_type endpoint)
{ {
answer_type answer; answer_type answer;
answer.body = API{endpoint}.to_string(); answer.body = API{endpoint}.to_string();
return answer; return answer;
} }
answer_type Request::get(string endpoint) const answer_type Request::get(string endpoint)
{ {
answer_type answer; answer_type answer;
answer.body = endpoint; answer.body = make_request(http_method::GET, "https://ip.tastytea.de/");
return answer; return answer;
} }