ZenLib
Http_Handler.h
Go to the documentation of this file.
00001 /*  Copyright (c) MediaArea.net SARL. All Rights Reserved.
00002  *
00003  *  Use of this source code is governed by a zlib-style license that can
00004  *  be found in the License.txt file in the root of the source tree.
00005  */
00006 
00007 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00008 //
00009 // A HTTP Request
00010 //
00011 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00012 
00013 //---------------------------------------------------------------------------
00014 #ifndef ZenLib_Format_Http_RequestH
00015 #define ZenLib_Format_Http_RequestH
00016 //---------------------------------------------------------------------------
00017 
00018 //---------------------------------------------------------------------------
00019 #include "ZenLib/Format/Http/Http_Cookies.h"
00020 #include <vector>
00021 //---------------------------------------------------------------------------
00022 
00023 namespace ZenLib
00024 {
00025 
00026 namespace Format
00027 {
00028 
00029 namespace Http
00030 {
00031 
00032 //***************************************************************************
00033 /// @brief
00034 //***************************************************************************
00035 
00036 class Handler
00037 {
00038 public:
00039     //Constructor/Destructor
00040     Handler();
00041 
00042     //In
00043     std::string                         Path;                   //The path being requested by this request
00044     std::map<std::string, std::string>  Request_Headers;        //All the incoming HTTP headers from the client web browser.
00045     std::map<std::string, std::string>  Request_Cookies;        //The set of cookies that came from the client along with this request
00046     std::map<std::string, std::string>  Request_Queries;        //All the key/value pairs in the query string of this request
00047     std::string                         Foreign_IP;             //The foreign ip address for this request
00048     std::string                         Local_IP;               //The foreign port number for this request
00049     unsigned short                      Foreign_Port;           //The IP of the local interface this request is coming in on
00050     unsigned short                      Local_Port;             //The local port number this request is coming in on
00051     bool                                HeadersOnly;            //The request requests only the header
00052 
00053     //Out
00054     size_t                              Response_HTTP_Code;     //HTTP code to be sent
00055     std::map<std::string, std::string>  Response_Headers;       //Additional headers you wish to appear in the HTTP response to this request
00056     Cookies                             Response_Cookies;       //New cookies to pass back to the client along with the result of this request
00057     std::string                         Response_Body;          //To be displayed as the response to this request
00058 };
00059 
00060 } //Namespace
00061 
00062 } //Namespace
00063 
00064 } //Namespace
00065 
00066 #endif