|
OpenTop 1.3 | |||||
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). However, HTTP 1.1 introduces persistent connections which can make more effective use of TCP/IP. OpenTop may make use of persistent connections, but this is an implementation detail which is not exposed to the HttpURLConnection interface.
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=0 Returns an InputStream that contains the output from the HTTP server after an error occurs. |
virtual bool |
getFollowRedirects() const=0 Returns a flag indicating whether HTTP redirects will be followed. |
virtual String |
getRequestMethod() const=0 Returns the request method. |
virtual int |
getResponseCode()=0 Returns the numeric response code returned from the HTTP server. |
virtual String |
getResponseMessage()=0 Returns 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)=0 Specifies whether or not HTTP redirect responses should be followed. |
virtual void |
setRequestMethod(const String& method)=0 Sets the request method that will be transmitted to the HTTP server. |
Methods inherited from class ot::ManagedObject |
addRef, getRefCount, onFinalRelease, operator=, release |
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.3 | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||
SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD |