@@ -14,7 +14,7 @@ class HttpResponse {
1414public:
1515 HttpResponse (int c, std::string b) : code_(c), body_(std::move(b)) {};
1616
17- [[nodiscard]] int status () const { return code_; }
17+ int status () const { return code_; }
1818 const std::string &body () const { return body_; }
1919
2020 bool is_ok () const { return code_ >= 200 && code_ < 300 ; }
@@ -33,7 +33,7 @@ class HttpRequest {
3333 HttpRequest (HttpClient &client, std::string URL)
3434 : client_(client), URL_(std::move(URL)), timeout_(0 ) {};
3535
36- [[nodiscard]] HttpRequest &header (const std::string &header,
36+ [[nodiscard]] HttpRequest &header (const std::string && header,
3737 const std::string &value) {
3838 headers_[header] = value;
3939 return *this ;
@@ -43,16 +43,16 @@ class HttpRequest {
4343 return *this ;
4444 }
4545
46- HttpResponse execute ();
46+ HttpResponse execute ();
4747
48- std::string getURL () { return URL_;}
49- int getTimeout () { return timeout_;}
48+ const std::string& getURL () const { return URL_; }
49+ const int getTimeout () const { return timeout_; }
5050
5151private:
5252 HttpClient &client_;
5353 std::string URL_;
5454 std::unordered_map<std::string, std::string> headers_;
55- int timeout_;
55+ int timeout_; // TODO(cristian): `std::chrono` ?
5656};
5757
5858// HttpClient should only focus on handling the cURL handle
0 commit comments