diff --git a/include/opendht/http.h b/include/opendht/http.h
index bf756dad357485242c6c22799c6f4736d6066511..523b40b38ef6f591d6c78ee4c3af11791ff18811 100644
--- a/include/opendht/http.h
+++ b/include/opendht/http.h
@@ -150,7 +150,9 @@ public:
 
     ~Resolver();
 
-    Url get_url() const;
+    inline const Url& get_url() const {
+        return url_;
+    };
     std::string get_service() const;
 
     void add_callback(ResolverCb cb);
@@ -209,7 +211,9 @@ public:
     unsigned int id() const;
     void set_connection(std::shared_ptr<Connection> connection);
     std::shared_ptr<Connection> get_connection() const;
-    Url get_url() const;
+    inline const Url& get_url() const {
+        return resolver_->get_url();
+    };
 
     void set_certificate(std::shared_ptr<dht::crypto::Certificate> certificate);
     void set_logger(std::shared_ptr<dht::Logger> logger);
diff --git a/src/http.cpp b/src/http.cpp
index 97855b051a43389f52af7d8448a0117b212b2ddb..ffae9845cc6884f55b3917de47641649be6fbf7e 100644
--- a/src/http.cpp
+++ b/src/http.cpp
@@ -345,12 +345,6 @@ Resolver::~Resolver()
     }
 }
 
-Url
-Resolver::get_url() const
-{
-    return url_;
-}
-
 void
 Resolver::add_callback(ResolverCb cb)
 {
@@ -455,12 +449,6 @@ Request::id() const
     return id_;
 }
 
-Url
-Request::get_url() const
-{
-    return resolver_->get_url();
-}
-
 void
 Request::set_connection(std::shared_ptr<Connection> connection)
 {