Commit 3 of 3 for Doxygen path fixes, this one finally removes all 600+ unnecessary...
[wxWidgets.git] / interface / wx / protocol / http.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: protocol/http.h
3 // Purpose: interface of wxHTTP
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxHTTP
11
12 wxHTTP can be used to establish a connection to an HTTP server.
13
14 @library{wxnet}
15 @category{net}
16
17 @see wxSocketBase, wxURL
18 */
19 class wxHTTP : public wxProtocol
20 {
21 public:
22 /**
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 string.
25
26 @note
27 The header is not case-sensitive, i.e. "CONTENT-TYPE" and "content-type"
28 represent the same header.
29 */
30 wxString GetHeader(const wxString& header);
31
32 /**
33 Creates a new input stream on the specified path.
34
35 Notice that this stream is unseekable, i.e. SeekI() and TellI() methods
36 shouldn't be used.
37
38 Note that you can still know the size of the file you are getting using
39 wxStreamBase::GetSize(). However there is a limitation: in HTTP protocol,
40 the size is not always specified so sometimes @c (size_t)-1 can returned to
41 indicate that the size is unknown.
42 In such case, you may want to use wxInputStream::LastRead() method in a loop
43 to get the total size.
44
45 @return Returns the initialized stream. You must delete it yourself
46 once you don't use it anymore and this must be done before
47 the wxHTTP object itself is destroyed. The destructor
48 closes the network connection. The next time you will
49 try to get a file the network connection will have to
50 be reestablished, but you don't have to take care of
51 this since wxHTTP reestablishes it automatically.
52
53 @see wxInputStream
54 */
55 wxInputStream* GetInputStream(const wxString& path);
56
57 /**
58 Returns the HTTP response code returned by the server.
59
60 Please refer to RFC 2616 for the list of responses.
61 */
62 int GetResponse() const;
63
64 /**
65 It sets data of a field to be sent during the next request to the HTTP server.
66
67 The field name is specified by @a header and the content by @e h_data.
68 This is a low level function and it assumes that you know what you are doing.
69 */
70 void SetHeader(const wxString& header, const wxString& h_data);
71 };
72