00001 // ZenLib::Format::Http::Request - A HTTP request 00002 // Copyright (C) 2008-2011 MediaArea.net SARL, Info@MediaArea.net 00003 // 00004 // This software is provided 'as-is', without any express or implied 00005 // warranty. In no event will the authors be held liable for any damages 00006 // arising from the use of this software. 00007 // 00008 // Permission is granted to anyone to use this software for any purpose, 00009 // including commercial applications, and to alter it and redistribute it 00010 // freely, subject to the following restrictions: 00011 // 00012 // 1. The origin of this software must not be misrepresented; you must not 00013 // claim that you wrote the original software. If you use this software 00014 // in a product, an acknowledgment in the product documentation would be 00015 // appreciated but is not required. 00016 // 2. Altered source versions must be plainly marked as such, and must not be 00017 // misrepresented as being the original software. 00018 // 3. This notice may not be removed or altered from any source distribution. 00019 // 00020 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00021 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00022 // 00023 // A HTTP Request 00024 // 00025 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00026 00027 //--------------------------------------------------------------------------- 00028 #ifndef ZenLib_Format_Http_RequestH 00029 #define ZenLib_Format_Http_RequestH 00030 //--------------------------------------------------------------------------- 00031 00032 //--------------------------------------------------------------------------- 00033 #include "ZenLib/Format/Http/Http_Cookies.h" 00034 #include <string> 00035 #include <ctime> 00036 #include <map> 00037 #include <vector> 00038 //--------------------------------------------------------------------------- 00039 00040 namespace ZenLib 00041 { 00042 00043 namespace Format 00044 { 00045 00046 namespace Http 00047 { 00048 00049 //*************************************************************************** 00050 /// @brief 00051 //*************************************************************************** 00052 00053 class Handler 00054 { 00055 public: 00056 //Constructor/Destructor 00057 Handler(); 00058 00059 //In 00060 std::string Path; //The path being requested by this request 00061 std::map<std::string, std::string> Request_Headers; //All the incoming HTTP headers from the client web browser. 00062 std::map<std::string, std::string> Request_Cookies; //The set of cookies that came from the client along with this request 00063 std::map<std::string, std::string> Request_Queries; //All the key/value pairs in the query string of this request 00064 std::string Foreign_IP; //The foreign ip address for this request 00065 std::string Local_IP; //The foreign port number for this request 00066 unsigned short Foreign_Port; //The IP of the local interface this request is coming in on 00067 unsigned short Local_Port; //The local port number this request is coming in on 00068 bool HeadersOnly; //The request requests only the header 00069 00070 //Out 00071 size_t Response_HTTP_Code; //HTTP code to be sent 00072 std::map<std::string, std::string> Response_Headers; //Additional headers you wish to appear in the HTTP response to this request 00073 Cookies Response_Cookies; //New cookies to pass back to the client along with the result of this request 00074 std::string Response_Body; //To be displayed as the response to this request 00075 }; 00076 00077 } //Namespace 00078 00079 } //Namespace 00080 00081 } //Namespace 00082 00083 #endif 00084 00085 00086 00087