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