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_STRING_HASH_MAP_WITH_DECL( wxString
, wxStringToStringHashMap
,
22 class WXDLLIMPEXP_NET
);
24 class WXDLLIMPEXP_NET wxHTTP
: public wxProtocol
30 bool Connect(const wxString
& host
, unsigned short port
= 0);
31 bool Connect(wxSockAddress
& addr
, bool wait
);
33 wxInputStream
*GetInputStream(const wxString
& path
);
34 inline wxProtocolError
GetError() { return m_perr
; }
35 wxString
GetContentType();
37 void SetHeader(const wxString
& header
, const wxString
& h_data
);
38 wxString
GetHeader(const wxString
& header
) const;
39 void SetPostBuffer(const wxString
& post_buf
);
41 void SetProxyMode(bool on
);
51 typedef wxStringToStringHashMap::iterator wxHeaderIterator
;
53 bool BuildRequest(const wxString
& path
, wxHTTP_Req req
);
57 // find the header in m_headers
58 wxHeaderIterator
FindHeader(const wxString
& header
) const;
60 // deletes the header value strings
63 wxProtocolError m_perr
;
64 wxStringToStringHashMap m_headers
;
67 wxSockAddress
*m_addr
;
70 DECLARE_DYNAMIC_CLASS(wxHTTP
)
71 DECLARE_PROTOCOL(wxHTTP
)
72 DECLARE_NO_COPY_CLASS(wxHTTP
)
75 #endif // wxUSE_PROTOCOL_HTTP