Odil
A C++11 library for the DICOM standard
HTTPRequest.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 _a927d586_9154_4f1e_bd56_82f2b6f0450d
10 #define _a927d586_9154_4f1e_bd56_82f2b6f0450d
11 
12 #include <string>
13 
14 #include "odil/odil.h"
16 #include "odil/webservices/URL.h"
17 
18 namespace odil
19 {
20 
21 namespace webservices
22 {
23 
26 {
27 public:
35  std::string const & method="", URL const & target=URL(),
36  std::string const & http_version="HTTP/1.0",
37  Headers const & headers=Headers(), std::string const & body="");
38 
40  virtual ~HTTPRequest();
41 
43  std::string const & get_method() const;
44 
46  void set_method(std::string const & method);
47 
49  URL const & get_target() const;
50 
52  void set_target(URL const & target);
53 
55  std::string const & get_http_version() const;
56 
58  void set_http_version(std::string const & http_version);
59 
60 private:
61  std::string _method;
62  URL _target;
63  std::string _http_version;
64 };
65 
68 std::istream &
69 operator>>(std::istream & stream, HTTPRequest & request);
70 
72 ODIL_API std::ostream &
73 operator<<(std::ostream & stream, HTTPRequest const & request);
74 
75 }
76 
77 }
78 
79 #endif // _a927d586_9154_4f1e_bd56_82f2b6f0450d
std::ostream & operator<<(std::ostream &stream, HTTPRequest const &request)
Output an HTTP request to a stream.
HTTP request.
Definition: HTTPRequest.h:25
RFC 5322 Message (i.e. headers with body).
Definition: Message.h:26
Definition: Association.h:24
Uniform resource locator.
Definition: URL.h:23
std::map< std::string, std::string > Headers
Associative container for headers.
Definition: Message.h:30
#define ODIL_API
Definition: odil.h:28
std::istream & operator>>(std::istream &stream, HTTPRequest &request)
Input an HTTP request from a stream.