1 \section{\class{wxHTTP
}}\label{wxhttp
}
3 \wxheading{Derived from
}
5 \helpref{wxProtocol
}{wxprotocol
}
7 \wxheading{Include files
}
13 \helpref{wxSocketBase
}{wxsocketbase
},
\helpref{wxURL
}{wxurl
}
15 % ----------------------------------------------------------------------------
17 % ----------------------------------------------------------------------------
19 % ----------------------------------------------------------------------------
20 \membersection{wxHTTP::GetResponse
}\label{wxhttpgetresponse
}
22 \constfunc{int
}{GetResponse
}{\void}
24 Returns 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.
28 \membersection{wxHTTP::GetInputStream
}\label{wxhttpgetinputstream
}
30 \func{wxInputStream *
}{GetInputStream
}{\param{const wxString\&
}{ path
}}
32 Creates a new input stream on the specified path. You can use all except the seek
33 functionality of wxStream. Seek isn't available on all streams. For example,
34 HTTP or FTP streams don't deal with it. Other functions like Tell and SeekI
35 aren't available for the moment for this sort of stream.
36 You will be notified when the EOF is reached by an error.
40 You can know the size of the file you are getting using
\helpref{wxStreamBase::GetSize()
}{wxstreambasegetsize
}.
41 But there is a limitation: as HTTP servers aren't obliged to pass the size of
42 the file, in some case, you will be returned
0xfffffff by GetSize(). In these
43 cases, you should use the value returned by
\helpref{wxInputStream::LastRead()
}{wxinputstreamlastread
}:
44 this value will be
0 when the stream is finished.
46 \wxheading{Return value
}
48 Returns the initialized stream. You will have to delete it yourself once you
49 don't use it anymore. The destructor closes the network connection.
50 The next time you will try to get a file the network connection will have
51 to be reestablished: but you don't have to take care of this since wxHTTP reestablishes it automatically.
55 \helpref{wxInputStream
}{wxinputstream
}
57 % ----------------------------------------------------------------------------
59 \membersection{wxHTTP::SetHeader
}\label{wxhttpsetheader
}
61 \func{void
}{SetHeader
}{\param{const wxString\&
}{ header
},
\param{const wxString\&
}{ h
\_data}}
63 It sets data of a field to be sent during the next request to the HTTP server. The field
64 name is specified by
{\it header
} and the content by
{\it h
\_data}.
65 This is a low level function and it assumes that you know what you are doing.
67 \membersection{wxHTTP::GetHeader
}\label{wxhttpgetheader
}
69 \func{wxString
}{GetHeader
}{\param{const wxString\&
}{ header
}}
71 Returns the data attached with a field whose name is specified by
{\it header
}.
72 If the field doesn't exist, it will return an empty string and not a NULL string.
76 The header is not case-sensitive, i.e. "CONTENT-TYPE" and "content-type"
77 represent the same header.