switched from PracticalSocket to libasio
[anytun.git] / src / Sockets / HttpTransaction.h
bloba92fddab6104e59fa4336a6e545de08ad5052216
1 /**
2 ** \file HttpTransaction.h
3 ** \date 2007-10-05
4 ** \author grymse@alhem.net
5 **/
6 /*
7 Copyright (C) 2007 Anders Hedstrom
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #ifndef _SOCKETS_HttpTransaction_H
24 #define _SOCKETS_HttpTransaction_H
26 #include <string>
27 #include <map>
29 #ifdef SOCKETS_NAMESPACE
30 namespace SOCKETS_NAMESPACE {
31 #endif
34 class HttpTransaction
36 public:
37 HttpTransaction();
38 virtual ~HttpTransaction();
40 /** Set / Read http header value */
41 void SetHeader(const std::string& key, const std::string& value);
42 void SetHeader(const std::string& key, long value);
43 const std::string& Header(const std::string& key) const;
45 void SetAccept(const std::string& value);
46 const std::string& Accept() const;
48 void SetAcceptCharset(const std::string& value);
49 const std::string& AcceptCharset() const;
51 void SetAcceptEncoding(const std::string& value);
52 const std::string& AcceptEncoding() const;
54 void SetAcceptLanguage(const std::string& value);
55 const std::string& AcceptLanguage() const;
57 void SetConnection(const std::string& value);
58 const std::string& Connection() const;
60 void SetContentType(const std::string& value);
61 const std::string& ContentType() const;
63 void SetContentLength(long value);
64 long ContentLength() const;
66 void SetHost(const std::string& value);
67 const std::string& Host() const;
69 void SetPragma(const std::string& value);
70 const std::string& Pragma() const;
72 void SetReferer(const std::string& value);
73 const std::string& Referer() const;
75 void SetUserAgent(const std::string& value);
76 const std::string& UserAgent() const;
78 const std::map<std::string, std::string>& Headers() const;
80 virtual void Reset();
82 private:
83 std::map<std::string, std::string> m_header;
84 std::string m_null;
86 }; // end of class
89 #ifdef SOCKETS_NAMESPACE
90 } // namespace SOCKETS_NAMESPACE {
91 #endif
93 #endif // _SOCKETS_HttpTransaction_H