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