response.h
Go to the documentation of this file.
/*
* Copyright © 2013 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Thomas Voß <thomas.voss@canonical.com>
*/
#ifndef CORE_NET_HTTP_RESPONSE_H_
#define CORE_NET_HTTP_RESPONSE_H_
#include <core/net/visibility.h>
#include <core/net/http/header.h>
#include <core/net/http/status.h>
#include <map>
#include <sstream>
#include <string>
namespace core
{
namespace net
{
namespace http
{
struct CORE_NET_DLL_PUBLIC Response
{
// TODO(tvoss): This really should be a stringstream, but libstdc++ is broken and
// does not define move operators correctly.
typedef std::string Body;
Status status{Status::bad_request};
Header header{};
Body body{};
};
}
}
}
#endif // CORE_NET_HTTP_RESPONSE_H_
core::net::http::Header
The Header class encapsulates the headers of an HTTP request/response.
Definition header.h:39
header.h
core::net::http
Definition client.h:39
core::net::http::Status
Status
Definition status.h:32
core::net::http::Status::bad_request
@ bad_request
Definition status.h:52
core::net
Definition error.h:28
core
Definition location.h:24
status.h
core::net::http::Response
The Response struct models a response to a core::net::http::Request.
Definition response.h:40
core::net::http::Response::header
Header header
The header fields of the response.
Definition response.h:49
core::net::http::Response::Body
std::string Body
The body of the response is a string.
Definition response.h:44
core::net::http::Response::body
Body body
The body of the response.
Definition response.h:51
core::net::http::Response::status
Status status
The HTTP status as sent by the server.
Definition response.h:47
visibility.h
CORE_NET_DLL_PUBLIC
#define CORE_NET_DLL_PUBLIC
Definition visibility.h:25