diff --git a/client_http.hpp b/client_http.hpp index e12fcd2..87d8367 100644 --- a/client_http.hpp +++ b/client_http.hpp @@ -72,11 +72,11 @@ namespace SimpleWeb { friend class ClientBase; public: - std::size_t size() noexcept { + std::size_t size() const noexcept { return streambuf.size(); } /// Convenience function to return content as a string. - std::string string() noexcept { + std::string string() const noexcept { return std::string(asio::buffers_begin(streambuf.data()), asio::buffers_end(streambuf.data())); } diff --git a/server_http.hpp b/server_http.hpp index b7591c2..baace86 100644 --- a/server_http.hpp +++ b/server_http.hpp @@ -135,7 +135,7 @@ namespace SimpleWeb { } public: - std::size_t size() noexcept { + std::size_t size() const noexcept { return streambuf->size(); } @@ -209,11 +209,11 @@ namespace SimpleWeb { friend class ServerBase; public: - std::size_t size() noexcept { + std::size_t size() const noexcept { return streambuf.size(); } /// Convenience function to return content as std::string. - std::string string() noexcept { + std::string string() const noexcept { return std::string(asio::buffers_begin(streambuf.data()), asio::buffers_end(streambuf.data())); }