]>
git.saurik.com Git - wxWidgets.git/blob - interface/protocol/http.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: protocol/http.h
3 // Purpose: interface of wxHTTP
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
11 @headerfile http.h wx/protocol/http.h
17 @see wxSocketBase, wxURL
19 class wxHTTP
: public wxProtocol
23 Returns the data attached with a field whose name is specified by @e header.
24 If the field doesn't exist, it will return an empty string and not a @NULL
27 wxString
GetHeader(const wxString
& header
);
30 Creates a new input stream on the specified path. Notice that this stream is
31 unseekable, i.e. SeekI() and TellI() methods shouldn't be used.
32 Note that you can still know the size of the file you are getting using
33 wxStreamBase::GetSize. However there is a
34 limitation: in HTTP protocol, the size is not always specified so sometimes
35 @c (size_t)-1 can returned ot indicate that the size is unknown. In such
36 case, you may want to use wxInputStream::LastRead
37 method in a loop to get the total size.
39 @returns Returns the initialized stream. You must delete it yourself once
40 you don't use it anymore and this must be done before
41 the wxHTTP object itself is destroyed. The destructor
42 closes the network connection. The next time you will
43 try to get a file the network connection will have to
44 be reestablished, but you don't have to take care of
45 this since wxHTTP reestablishes it automatically.
49 wxInputStream
* GetInputStream(const wxString
& path
);
52 Returns the HTTP response code returned by the server. Please refer to
53 RFC 2616 for the list of responses.
55 int GetResponse() const;
58 It sets data of a field to be sent during the next request to the HTTP server.
60 name is specified by @a header and the content by @e h_data.
61 This is a low level function and it assumes that you know what you are doing.
63 void SetHeader(const wxString
& header
, const wxString
& h_data
);