]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/http.tex
added new text event macros description
[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% ----------------------------------------------------------------------------
721b32e0 20\membersection{wxHTTP::GetInputStream}\label{wxhttpgetinputstream}
0d6957a5
GL
21
22\func{wxInputStream *}{GetInputStream}{\param{const wxString\&}{ path}}
23
721b32e0
JS
24Creates a new input stream on the the specified path. You can use all except the seek
25functionality of wxStream. Seek isn't available on all streams. For example,
39b91eca
GL
26http or ftp streams doesn't deal with it. Other functions like Tell and SeekI
27for this sort of stream.
0d6957a5
GL
28You will be notified when the EOF is reached by an error.
29
39b91eca
GL
30\wxheading{Note}
31
32You can know the size of the file you are getting using \helpref{wxStreamBase::GetSize()}{wxstreambasegetsize}.
33But there is a limitation: as HTTP servers aren't obliged to pass the size ofi
34the file, in some case, you will be returned 0xfffffff by GetSize(). In these
35cases, you should use the value returned by \helpref{wxInputStream::LastRead()}{wxinputstreamlastread}:
36this value will be 0 when the stream is finished.
37
0d6957a5
GL
38\wxheading{Return value}
39
40Returns the initialized stream. You will have to delete it yourself once you
41don't use it anymore. The destructor closes the network connection.
42The next time you will try to get a file the network connection will have
43to be reestablished: but you don't have to take care of this wxHTTP reestablishes it automatically.
44
45\wxheading{See also}
46
47\helpref{wxInputStream}{wxinputstream}
48
49% ----------------------------------------------------------------------------
50
51\membersection{wxHTTP::SetHeader}
52
294e9a7a 53\func{void}{SetHeader}{\param{const wxString\&}{ header}, \param{const wxString\&}{ h\_data}}
0d6957a5
GL
54
55It sets data of a field to be sent during the next request to the HTTP server. The field
605d715d 56name is specified by {\it header} and the content by {\it h\_data}.
0d6957a5
GL
57This is a low level function and it assumes that you know what you are doing.
58
39b91eca 59\membersection{wxHTTP::GetHeader}
721b32e0 60
0d6957a5
GL
61\func{wxString}{GetHeader}{\param{const wxString\&}{ header}}
62
605d715d 63Returns the data attached with a field whose name is specified by {\it header}.
0d6957a5 64If the field doesn't exist, it will return an empty string and not a NULL string.
721b32e0 65
39b91eca
GL
66\wxheading{Note}
67
68The header is not case-sensitive: I mean that "CONTENT-TYPE" and "content-type"
69represent the same header.
22d6efa8 70