1 \section{\class{wxHTTP
}}\label{wxhttp
}
3 \wxheading{Derived from
}
5 \helpref{wxProtocol
}{wxprotocol
}
7 \wxheading{Include files
}
13 \helpref{wxNet
}{librarieslist
}
17 \helpref{wxSocketBase
}{wxsocketbase
},
\helpref{wxURL
}{wxurl
}
19 % ----------------------------------------------------------------------------
21 % ----------------------------------------------------------------------------
23 % ----------------------------------------------------------------------------
24 \membersection{wxHTTP::GetResponse
}\label{wxhttpgetresponse
}
26 \constfunc{int
}{GetResponse
}{\void}
28 Returns 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.
32 \membersection{wxHTTP::GetInputStream
}\label{wxhttpgetinputstream
}
34 \func{wxInputStream *
}{GetInputStream
}{\param{const wxString\&
}{ path
}}
36 Creates a new input stream on the specified path. Notice that this stream is
37 unseekable, i.e. SeekI() and TellI() methods shouldn't be used.
39 Note that you can still know the size of the file you are getting using
40 \helpref{wxStreamBase::GetSize()
}{wxstreambasegetsize
}. However there is a
41 limitation: 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
43 case, you may want to use
\helpref{wxInputStream::LastRead()
}{wxinputstreamlastread
}
44 method in a loop to get the total size.
46 \wxheading{Return value
}
48 Returns the initialized stream. You must delete it yourself once you
49 don't use it anymore and this must be done before the wxHTTP object itself is
50 destroyed. The destructor closes the network connection. The next time you will
51 try to get a file the network connection will have to be reestablished, but you
52 don't have to take care of this since wxHTTP reestablishes it automatically.
56 \helpref{wxInputStream
}{wxinputstream
}
58 % ----------------------------------------------------------------------------
60 \membersection{wxHTTP::SetHeader
}\label{wxhttpsetheader
}
62 \func{void
}{SetHeader
}{\param{const wxString\&
}{ header
},
\param{const wxString\&
}{ h
\_data}}
64 It sets data of a field to be sent during the next request to the HTTP server. The field
65 name is specified by
{\it header
} and the content by
{\it h
\_data}.
66 This is a low level function and it assumes that you know what you are doing.
68 \membersection{wxHTTP::GetHeader
}\label{wxhttpgetheader
}
70 \func{wxString
}{GetHeader
}{\param{const wxString\&
}{ header
}}
72 Returns the data attached with a field whose name is specified by
{\it header
}.
73 If the field doesn't exist, it will return an empty string and not a NULL string.
77 The header is not case-sensitive, i.e. "CONTENT-TYPE" and "content-type"
78 represent the same header.