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