]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/http.tex
added the mention of library in which each class is defined to the documentation...
[wxWidgets.git] / docs / latex / wx / http.tex
1 \section{\class{wxHTTP}}\label{wxhttp}
2
3 \wxheading{Derived from}
4
5 \helpref{wxProtocol}{wxprotocol}
6
7 \wxheading{Include files}
8
9 <wx/protocol/http.h>
10
11 \wxheading{Library}
12
13 \helpref{wxNet}{librarieslist}
14
15 \wxheading{See also}
16
17 \helpref{wxSocketBase}{wxsocketbase}, \helpref{wxURL}{wxurl}
18
19 % ----------------------------------------------------------------------------
20 % Members
21 % ----------------------------------------------------------------------------
22
23 % ----------------------------------------------------------------------------
24 \membersection{wxHTTP::GetResponse}\label{wxhttpgetresponse}
25
26 \constfunc{int}{GetResponse}{\void}
27
28 Returns the HTTP response code returned by the server. Please refer to
29 \urlref{RFC 2616}{http://www.faqs.org/rfcs/rfc2616.html} for the list of responses.
30
31
32 \membersection{wxHTTP::GetInputStream}\label{wxhttpgetinputstream}
33
34 \func{wxInputStream *}{GetInputStream}{\param{const wxString\&}{ path}}
35
36 Creates a new input stream on the specified path. Notice that this stream is
37 unseekable, i.e. SeekI() and TellI() methods shouldn't be used.
38
39 Note that you can still know the size of the file you are getting using
40 \helpref{wxStreamBase::GetSize()}{wxstreambasegetsize}. However there is a
41 limitation: in HTTP protocol, the size is not always specified so sometimes
42 \texttt{(size\_t)-1} can returned ot indicate that the size is unknown. In such
43 case, you may want to use \helpref{wxInputStream::LastRead()}{wxinputstreamlastread}
44 method in a loop to get the total size.
45
46 \wxheading{Return value}
47
48 Returns the initialized stream. You must delete it yourself once you
49 don't use it anymore and this must be done before the wxHTTP object itself is
50 destroyed. The destructor closes the network connection. The next time you will
51 try to get a file the network connection will have to be reestablished, but you
52 don't have to take care of this since wxHTTP reestablishes it automatically.
53
54 \wxheading{See also}
55
56 \helpref{wxInputStream}{wxinputstream}
57
58 % ----------------------------------------------------------------------------
59
60 \membersection{wxHTTP::SetHeader}\label{wxhttpsetheader}
61
62 \func{void}{SetHeader}{\param{const wxString\&}{ header}, \param{const wxString\&}{ h\_data}}
63
64 It sets data of a field to be sent during the next request to the HTTP server. The field
65 name is specified by {\it header} and the content by {\it h\_data}.
66 This is a low level function and it assumes that you know what you are doing.
67
68 \membersection{wxHTTP::GetHeader}\label{wxhttpgetheader}
69
70 \func{wxString}{GetHeader}{\param{const wxString\&}{ header}}
71
72 Returns the data attached with a field whose name is specified by {\it header}.
73 If the field doesn't exist, it will return an empty string and not a NULL string.
74
75 \wxheading{Note}
76
77 The header is not case-sensitive, i.e. "CONTENT-TYPE" and "content-type"
78 represent the same header.
79