]>
Commit | Line | Data |
---|---|---|
f4ada568 GL |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: http.h | |
3 | // Purpose: HTTP protocol | |
4 | // Author: Guilhem Lavaux | |
5 | // Modified by: | |
6 | // Created: August 1997 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 1997, 1998 Guilhem Lavaux | |
9 | // Licence: wxWindows license | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | #ifndef _WX_HTTP_H | |
12 | #define _WX_HTTP_H | |
13 | ||
14 | #include "wx/list.h" | |
15 | #include "wx/protocol/protocol.h" | |
16 | ||
17 | class WXDLLEXPORT wxHTTP : public wxProtocol { | |
18 | DECLARE_DYNAMIC_CLASS(wxHTTP) | |
19 | DECLARE_PROTOCOL(wxHTTP) | |
20 | protected: | |
21 | wxProtocolError m_perr; | |
22 | wxList m_headers; | |
f61815af | 23 | bool m_read, m_proxy_mode; |
f4ada568 GL |
24 | wxSockAddress *m_addr; |
25 | public: | |
26 | wxHTTP(); | |
27 | ~wxHTTP(); | |
28 | ||
29 | bool Connect(const wxString& host); | |
8a2c6ef8 | 30 | bool Connect(wxSockAddress& addr, bool wait); |
f4ada568 GL |
31 | bool Abort(); |
32 | wxInputStream *GetInputStream(const wxString& path); | |
33 | inline wxProtocolError GetError() { return m_perr; } | |
34 | wxString GetContentType(); | |
35 | ||
36 | void SetHeader(const wxString& header, const wxString& h_data); | |
37 | wxString GetHeader(const wxString& header); | |
38 | ||
f61815af GL |
39 | void SetProxyMode(bool on); |
40 | ||
f4ada568 GL |
41 | protected: |
42 | typedef enum { | |
a58d5df4 GL |
43 | wxHTTP_GET, |
44 | wxHTTP_HEAD | |
f4ada568 GL |
45 | } wxHTTP_Req; |
46 | bool BuildRequest(const wxString& path, wxHTTP_Req req); | |
47 | void SendHeaders(); | |
48 | bool ParseHeaders(); | |
49 | }; | |
50 | ||
51 | #endif |