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
29 bool Connect(const wxString
& host
, unsigned short port
= 0);
30 bool Connect(wxSockAddress
& addr
, bool wait
);
32 wxInputStream
*GetInputStream(const wxString
& path
);
33 inline wxProtocolError
GetError() { return m_perr
; }
34 wxString
GetContentType();
36 void SetHeader(const wxString
& header
, const wxString
& h_data
);
37 wxString
GetHeader(const wxString
& header
) const;
38 void SetPostBuffer(const wxString
& post_buf
);
40 void SetProxyMode(bool on
);
50 typedef wxStringToStringHashMap::iterator wxHeaderIterator
;
52 bool BuildRequest(const wxString
& path
, wxHTTP_Req req
);
56 // find the header in m_headers
57 wxHeaderIterator
FindHeader(const wxString
& header
) const;
59 // deletes the header value strings
62 wxProtocolError m_perr
;
63 wxStringToStringHashMap m_headers
;
66 wxSockAddress
*m_addr
;
69 DECLARE_DYNAMIC_CLASS(wxHTTP
)
70 DECLARE_PROTOCOL(wxHTTP
)
71 DECLARE_NO_COPY_CLASS(wxHTTP
)
74 #endif // wxUSE_PROTOCOL_HTTP