Odil
A C++11 library for the DICOM standard
HTTPResponse.h
Go to the documentation of this file.
1/*************************************************************************
2 * odil - Copyright (C) Universite de Strasbourg
3 * Distributed under the terms of the CeCILL-B license, as published by
4 * the CEA-CNRS-INRIA. Refer to the LICENSE file or to
5 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
6 * for details.
7 ************************************************************************/
8
9#ifndef _c08db816_ac02_484c_8e9a_ab816c5198c7
10#define _c08db816_ac02_484c_8e9a_ab816c5198c7
11
12#include <string>
13
14#include "odil/odil.h"
16
17namespace odil
18{
19
20namespace webservices
21{
22
25{
26public:
34 std::string const & http_version="",
35 unsigned int status=0, std::string const & reason="",
36 Headers const & headers={}, std::string const & body="");
37
38 HTTPResponse(HTTPResponse const &) = default;
40 HTTPResponse & operator=(HTTPResponse const &) = default;
42 virtual ~HTTPResponse() = default;
43
45 std::string const & get_http_version() const;
46
48 void set_http_version(std::string const & http_version);
49
51 unsigned int get_status() const;
52
54 void set_status(unsigned int status);
55
57 std::string const & get_reason() const;
58
60 void set_reason(std::string const & target);
61
62private:
63 std::string _http_version;
64 unsigned int _status;
65 std::string _reason;
66};
67
70std::istream &
71operator>>(std::istream & stream, HTTPResponse & Response);
72
75std::ostream &
76operator<<(std::ostream & stream, HTTPResponse const & Response);
77
78}
79
80}
81
82#endif // _c08db816_ac02_484c_8e9a_ab816c5198c7
HTTP Response.
Definition: HTTPResponse.h:25
void set_http_version(std::string const &http_version)
Set the HTTP version.
void set_reason(std::string const &target)
Set the reason.
void set_status(unsigned int status)
Set the status.
std::string const & get_reason() const
Return the reason.
std::string const & get_http_version() const
Return the HTTP version.
HTTPResponse(std::string const &http_version="", unsigned int status=0, std::string const &reason="", Headers const &headers={}, std::string const &body="")
Constructor.
HTTPResponse(HTTPResponse &&)=default
HTTPResponse(HTTPResponse const &)=default
HTTPResponse & operator=(HTTPResponse &&)=default
virtual ~HTTPResponse()=default
unsigned int get_status() const
Return the status.
HTTPResponse & operator=(HTTPResponse const &)=default
RFC 5322 Message (i.e. headers with body).
Definition: Message.h:27
std::map< std::string, std::string > Headers
Associative container for headers.
Definition: Message.h:30
std::istream & operator>>(std::istream &stream, HTTPRequest &request)
Input an HTTP request from a stream.
std::ostream & operator<<(std::ostream &stream, HTTPRequest const &request)
Output an HTTP request to a stream.
Definition: Association.h:25
#define ODIL_API
Definition: odil.h:28