|
OpenTop 1.5 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||||
| SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD | |||||||
#include "ot/net/HttpURLConnection.h"

HTTP stands for Hyper Text Transfer Protocol, which is defined by RFCs published by the Internet Engineering Task Force.
A HttpURLConnection instance can make only one HTTP request (although this one request may involve several message exchanges if HTTP redirection or authorization is involved). When an application makes multiple HTTP requests to the same server, the underlying OpenTop framework classes will attempt to maximize network efficiency by making use of persistent HTTP connections. Note, however, that not all HTTP servers support persistent connections and only idempotent requests will be considered for transmission over an existing persistent connection..
| Constructor/Destructor Summary | |
HttpURLConnection(const URL& url)Constructs a HttpURLConnection for the specified HTTP URL. | |
| Method Summary | |
static bool |
GetDefaultFollowRedirects()Returns the global FollowRedirects value which is used to initialize new HttpURLConnection objects. |
virtual RefPtr< InputStream > |
getErrorStream() const=0Returns an InputStream that contains the output from the HTTP server after an error occurs. |
virtual bool |
getFollowRedirects() const=0Returns a flag indicating whether HTTP redirects will be followed. |
virtual String |
getRequestMethod() const=0Returns the request method. |
virtual int |
getResponseCode()=0Returns the numeric response code returned from the HTTP server. |
virtual String |
getResponseMessage()=0Returns the message text from the HTTP response line. |
static void |
SetDefaultFollowRedirects(bool bFollow)Set the global FollowRedirects value which is used to initialize new HttpURLConnection objects. |
virtual void |
setFollowRedirects(bool bFollow)=0Specifies whether or not HTTP redirect responses should be followed. |
virtual void |
setRequestMethod(const String& method)=0Sets the request method that will be transmitted to the HTTP server. |
| Methods inherited from class ot::ManagedObject |
addRef(), getRefCount(), onFinalRelease(), operator=(const ManagedObject&), release() |
| Methods inherited from class ot::net::URLConnection |
connect(), getConnectTimeout(), getContentEncoding(), getContentLength(), getContentType(), getDate(), GetDefaultConnectTimeout(), GetDefaultTimeout(), GetDefaultUseCaches(), getDoInput(), getDoOutput(), getHeaderField(const String&), getHeaderField(size_t), getHeaderFieldCount(), getHeaderFieldDate(const String&), getHeaderFieldKey(size_t), getHeaderFieldLong(const String&, long), getInputStream(), getLastModified(), getOutputStream(), getRequestProperty(const String&), getTimeout(), getURL(), getUseCaches(), isConnected(), resetHeaderFields(), setConnected(bool), setConnectTimeout(size_t), SetDefaultConnectTimeout(size_t), SetDefaultTimeout(size_t), SetDefaultUseCaches(bool), setDoInput(bool), setDoOutput(bool), setRequestProperty(const String&, const String&), setTimeout(size_t), setURL(const URL&), setUseCaches(bool) |
| Enumerations |
enum HttpResponseCode { |
HTTP_ACCEPTED =202, |
|
|
HTTP_BAD_GATEWAY =502, |
|
|
HTTP_BAD_METHOD =405, |
|
|
HTTP_BAD_REQUEST =400, |
|
|
HTTP_CLIENT_TIMEOUT =408, |
|
|
HTTP_CONFLICT =409, |
|
|
HTTP_CREATED =201, |
|
|
HTTP_ENTITY_TOO_LARGE =413, |
|
|
HTTP_FORBIDDEN =403, |
|
|
HTTP_GATEWAY_TIMEOUT =504, |
|
|
HTTP_GONE =410, |
|
|
HTTP_INTERNAL_ERROR =500, |
|
|
HTTP_LENGTH_REQUIRED =411, |
|
|
HTTP_MOVED_PERM =301, |
|
|
HTTP_MOVED_TEMP =302, |
|
|
HTTP_MULT_CHOICE =300, |
|
|
HTTP_NO_CONTENT =204, |
|
|
HTTP_NOT_ACCEPTABLE =406, |
|
|
HTTP_NOT_AUTHORITATIVE =203, |
|
|
HTTP_NOT_FOUND =404, |
|
|
HTTP_NOT_IMPLEMENTED =501, |
|
|
HTTP_NOT_MODIFIED =304, |
|
|
HTTP_OK =200, |
|
|
HTTP_PARTIAL =206, |
|
|
HTTP_PAYMENT_REQUIRED =402, |
|
|
HTTP_PRECON_FAILED =412, |
|
|
HTTP_PROXY_AUTH =407, |
|
|
HTTP_REQ_TOO_LONG =414, |
|
|
HTTP_RESET =205, |
|
|
HTTP_SEE_OTHER =303, |
|
|
HTTP_UNAUTHORIZED =401, |
|
|
HTTP_UNAVAILABLE =503, |
|
|
HTTP_UNSUPPORTED_TYPE =415, |
|
|
HTTP_USE_PROXY =305, |
|
|
HTTP_VERSION =505} |
|
| Constructor/Destructor Detail |
HttpURLConnection(const URL& url)
| Method Detail |
static bool GetDefaultFollowRedirects()
virtual RefPtr< InputStream > getErrorStream() const=0
virtual bool getFollowRedirects() const=0
virtual String getRequestMethod() const=0
virtual int getResponseCode()=0
Refer to the enumeration HttpURLConnection::HttpResponseCode for a list of possible values.
IOException - virtual String getResponseMessage()=0
static void SetDefaultFollowRedirects(bool bFollow)
The default value is true.
virtual void setFollowRedirects(bool bFollow)=0
virtual void setRequestMethod(const String& method)=0
ProtocolException -
|
OpenTop 1.5 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||||
| SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD | |||||||