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