OSDN Git Service

Refactoring HTTP parser.
[ultramonkey-l7/sslproxy.git] / include / http_request.h
1 /*
2  * @file  http_request.h
3  * @brief HTTP Request Message Header
4  *
5  * Copyright (C) 2009  NTT COMWARE Corporation.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA
21  *
22  **********************************************************************/
23
24 #ifndef __HTTP_REQUEST_H__
25 #define __HTTP_REQUEST_H__
26
27 #include <boost/multi_index_container.hpp>
28 #include <boost/multi_index/member.hpp>
29 #include <boost/multi_index/hashed_index.hpp>
30 #include <boost/multi_index/sequenced_index.hpp>
31 #include <string>
32 #include "http_message.h"
33 #include "http_request_enum.h"
34 #include "logger_wrapper.h"
35
36 //! HTTP Request Class (RFC2616)
37 class http_request : public http_message
38 {
39 private:
40     std::string         _method;
41     std::string         _request_uri;
42     std::string         _http_version;
43
44 public:
45     http_request();
46     http_request( std::string );
47     ~http_request();
48
49     std::string method();
50     std::string method( std::string );
51     std::string request_uri();
52     std::string request_uri( std::string );
53     std::string http_version();
54     std::string http_version( std::string );
55     std::string request_line();
56     std::string as_string();
57     void parse( std::string );
58     void rebuild();
59 };
60
61 #endif //__HTTP_REQUEST_H__