]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/http.tex
document that Remove(index) doesn't delete the window neither (replaces patch 1470834)
[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
11\wxheading{See also}
12
13\helpref{wxSocketBase}{wxsocketbase}, \helpref{wxURL}{wxurl}
14
15% ----------------------------------------------------------------------------
16% Members
17% ----------------------------------------------------------------------------
18
19% ----------------------------------------------------------------------------
2e622163
VZ
20\membersection{wxHTTP::GetResponse}\label{wxhttpgetresponse}
21
22\constfunc{int}{GetResponse}{\void}
23
4e43c815
VZ
24Returns the HTTP response code returned by the server. Please refer to
25\urlref{RFC 2616}{http://www.faqs.org/rfcs/rfc2616.html} for the list of responses.
2e622163
VZ
26
27
721b32e0 28\membersection{wxHTTP::GetInputStream}\label{wxhttpgetinputstream}
0d6957a5
GL
29
30\func{wxInputStream *}{GetInputStream}{\param{const wxString\&}{ path}}
31
43e8916f 32Creates a new input stream on the specified path. You can use all except the seek
721b32e0 33functionality of wxStream. Seek isn't available on all streams. For example,
39b91eca
GL
34http or ftp streams doesn't deal with it. Other functions like Tell and SeekI
35for this sort of stream.
0d6957a5
GL
36You will be notified when the EOF is reached by an error.
37
39b91eca
GL
38\wxheading{Note}
39
40You can know the size of the file you are getting using \helpref{wxStreamBase::GetSize()}{wxstreambasegetsize}.
2edb0bde 41But there is a limitation: as HTTP servers aren't obliged to pass the size of
39b91eca
GL
42the file, in some case, you will be returned 0xfffffff by GetSize(). In these
43cases, you should use the value returned by \helpref{wxInputStream::LastRead()}{wxinputstreamlastread}:
44this value will be 0 when the stream is finished.
45
0d6957a5
GL
46\wxheading{Return value}
47
48Returns the initialized stream. You will have to delete it yourself once you
49don't use it anymore. The destructor closes the network connection.
50The next time you will try to get a file the network connection will have
4e43c815 51to be reestablished: but you don't have to take care of this since wxHTTP reestablishes it automatically.
0d6957a5
GL
52
53\wxheading{See also}
54
55\helpref{wxInputStream}{wxinputstream}
56
57% ----------------------------------------------------------------------------
58
f0e8a2d0 59\membersection{wxHTTP::SetHeader}\label{wxhttpsetheader}
0d6957a5 60
294e9a7a 61\func{void}{SetHeader}{\param{const wxString\&}{ header}, \param{const wxString\&}{ h\_data}}
0d6957a5
GL
62
63It sets data of a field to be sent during the next request to the HTTP server. The field
605d715d 64name is specified by {\it header} and the content by {\it h\_data}.
0d6957a5
GL
65This is a low level function and it assumes that you know what you are doing.
66
f0e8a2d0 67\membersection{wxHTTP::GetHeader}\label{wxhttpgetheader}
721b32e0 68
0d6957a5
GL
69\func{wxString}{GetHeader}{\param{const wxString\&}{ header}}
70
605d715d 71Returns the data attached with a field whose name is specified by {\it header}.
0d6957a5 72If the field doesn't exist, it will return an empty string and not a NULL string.
721b32e0 73
39b91eca
GL
74\wxheading{Note}
75
4e43c815 76The header is not case-sensitive, i.e. "CONTENT-TYPE" and "content-type"
39b91eca 77represent the same header.
22d6efa8 78