6#include <kaycxx/http/header.hpp>
7#include <kaycxx/http/response_base.hpp>
9#include <nlohmann/json.hpp>
15namespace kaycxx::http {
36 [[nodiscard]] std::string_view
text() const & noexcept;
43 [[nodiscard]] std::
string text() && noexcept;
nlohmann::json json() const
Parses and returns the response body as JSON.
std::string_view text() const &noexcept
Returns a non-owning view of the response body without interpreting its contents.
buffered_response(int status_code, std::string body, std::vector< kaycxx::http::header > headers={})
Creates a buffered HTTP response.
int status_code() const noexcept
Returns the HTTP status code.
response_base(int status_code, std::vector< kaycxx::http::header > headers)
Creates common HTTP response data.
const std::vector< kaycxx::http::header > & headers() const &noexcept
Returns all response headers in their received order.