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