1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: HTTP protocol
4 // Author: Guilhem Lavaux
6 // Created: August 1997
8 // Copyright: (c) 1997, 1998 Guilhem Lavaux
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #if wxUSE_PROTOCOL_HTTP
18 #include "wx/hashmap.h"
19 #include "wx/protocol/protocol.h"
21 WX_DECLARE_EXPORTED_STRING_HASH_MAP( wxString
, wxStringToStringHashMap
);
23 class WXDLLIMPEXP_BASE wxHTTP
: public wxProtocol
{
24 DECLARE_DYNAMIC_CLASS(wxHTTP
)
25 DECLARE_PROTOCOL(wxHTTP
)
27 wxProtocolError m_perr
;
28 wxStringToStringHashMap m_headers
;
29 bool m_read
, m_proxy_mode
;
30 wxSockAddress
*m_addr
;
35 bool Connect(const wxString
& host
);
36 bool Connect(wxSockAddress
& addr
, bool wait
);
38 wxInputStream
*GetInputStream(const wxString
& path
);
39 inline wxProtocolError
GetError() { return m_perr
; }
40 wxString
GetContentType();
42 void SetHeader(const wxString
& header
, const wxString
& h_data
);
43 wxString
GetHeader(const wxString
& header
);
45 void SetProxyMode(bool on
);
52 bool BuildRequest(const wxString
& path
, wxHTTP_Req req
);
56 // deletes the header value strings
59 DECLARE_NO_COPY_CLASS(wxHTTP
)
62 #endif // wxUSE_PROTOCOL_HTTP