18 #ifndef _DECAF_NET_HTTPURLCONNECTION_H_
19 #define _DECAF_NET_HTTPURLCONNECTION_H_
265 static bool followRedirects;
267 static const int DEFAULT_CHUNK_LENGTH;
288 virtual void disconnect() = 0;
319 int getResponseCode();
328 std::string getResponseMessage();
341 void setRequestMethod(
const std::string& method);
349 return instanceFollowRedirects;
359 instanceFollowRedirects = followRedirects;
373 void setFixedLengthStreamingMode(
int contentLength);
386 void setChunkedStreamingMode(
int chunklen);
397 return followRedirects;
408 followRedirects = follow;
static const int HTTP_MOVED_TEMP
Numeric status code, 302: Moved temporarily.
Definition: HttpURLConnection.h:161
static const int HTTP_NO_CONTENT
Numeric status code, 204: No content.
Definition: HttpURLConnection.h:171
static const int HTTP_UNSUPPORTED_TYPE
Numeric status code, 415: Unsupported type.
Definition: HttpURLConnection.h:251
static const int HTTP_PROXY_AUTH
Numeric status code, 407: Proxy authentication required.
Definition: HttpURLConnection.h:221
int fixedContentLength
If using HTTP fixed-length streaming mode this parameter defines the fixed length of content...
Definition: HttpURLConnection.h:84
Concrete implementations of the abstract.
Definition: URLConnection.h:41
static const int HTTP_LENGTH_REQUIRED
Numeric status code, 411: Length required.
Definition: HttpURLConnection.h:151
static const int HTTP_NOT_MODIFIED
Numeric status code, 304: Not modified.
Definition: HttpURLConnection.h:196
#define NULL
Definition: Config.h:33
int chunkLength
If the HTTP chunked encoding is enabled this parameter defines the chunk-length.
Definition: HttpURLConnection.h:77
static const int HTTP_SEE_OTHER
Numeric status code, 303: See other.
Definition: HttpURLConnection.h:236
static const int HTTP_GATEWAY_TIMEOUT
Numeric status code, 504: Gateway timeout.
Definition: HttpURLConnection.h:136
static const int HTTP_NOT_FOUND
Numeric status code, 404: Not found.
Definition: HttpURLConnection.h:186
static const int HTTP_UNAUTHORIZED
Numeric status code, 401: Unauthorized.
Definition: HttpURLConnection.h:246
bool instanceFollowRedirects
Flag to define whether the protocol will automatically follow redirects or not.
Definition: HttpURLConnection.h:70
static const int HTTP_PARTIAL
Numeric status code, 206: Partial.
Definition: HttpURLConnection.h:206
static const int HTTP_MULT_CHOICE
Numeric status code, 300: Multiple choices.
Definition: HttpURLConnection.h:166
static const int HTTP_NOT_IMPLEMENTED
Numeric status code, 501: Not implemented.
Definition: HttpURLConnection.h:191
static const int HTTP_BAD_METHOD
Numeric status code, 405: Bad Method.
Definition: HttpURLConnection.h:101
static const int HTTP_VERSION
Numeric status code, 505: Version not supported.
Definition: HttpURLConnection.h:261
bool getInstanceFollowRedirects() const
Returns whether this connection follows redirects.
Definition: HttpURLConnection.h:348
static const int HTTP_NOT_AUTHORITATIVE
Numeric status code, 203: Not authoritative.
Definition: HttpURLConnection.h:181
static bool getFollowRedirects()
Returns the value of followRedirects which indicates if this connection follows a different URL redir...
Definition: HttpURLConnection.h:396
static const int HTTP_CLIENT_TIMEOUT
Numeric status code, 408: Client Timeout.
Definition: HttpURLConnection.h:111
void setInstanceFollowRedirects(bool followRedirects)
Sets whether this connection follows redirects.
Definition: HttpURLConnection.h:358
static const int HTTP_UNAVAILABLE
Numeric status code, 503: Unavailable.
Definition: HttpURLConnection.h:256
static const int HTTP_FORBIDDEN
Numeric status code, 403: Forbidden.
Definition: HttpURLConnection.h:131
std::string responseMessage
The HTTP response message which corresponds to the response code.
Definition: HttpURLConnection.h:64
static const int HTTP_BAD_REQUEST
Numeric status code, 400: Bad Request.
Definition: HttpURLConnection.h:106
std::string getRequestMethod() const
Returns the request method which will be used to make the request to the remote HTTP server...
Definition: HttpURLConnection.h:308
int responseCode
The status code of the response obtained from the HTTP request.
Definition: HttpURLConnection.h:59
static const int HTTP_CONFLICT
Numeric status code, 409: Conflict.
Definition: HttpURLConnection.h:116
std::string method
The HTTP request method of this HttpURLConnection.
Definition: HttpURLConnection.h:47
static const int HTTP_MOVED_PERM
Numeric status code, 301 Moved permanently.
Definition: HttpURLConnection.h:156
This abstract subclass of URLConnection defines methods for managing HTTP connection according to the...
Definition: HttpURLConnection.h:41
static const int HTTP_GONE
Numeric status code, 410: Gone.
Definition: HttpURLConnection.h:141
static const int HTTP_PRECON_FAILED
Numeric status code, 412: Precondition failed.
Definition: HttpURLConnection.h:216
static const int HTTP_PAYMENT_REQUIRED
Numeric status code, 402: Payment required.
Definition: HttpURLConnection.h:211
static const int HTTP_OK
Numeric status code, 200: OK.
Definition: HttpURLConnection.h:201
#define DECAF_API
Definition: Config.h:29
static const int HTTP_RESET
Numeric status code, 205: Reset.
Definition: HttpURLConnection.h:231
static const int HTTP_ACCEPTED
Numeric status code, 202: Accepted.
Definition: HttpURLConnection.h:91
static const int HTTP_REQ_TOO_LONG
Numeric status code, 414: Request too long.
Definition: HttpURLConnection.h:226
static void setFollowRedirects(bool follow)
Sets the flag of whether this connection will follow redirects returned by the remote server...
Definition: HttpURLConnection.h:407
static const int HTTP_CREATED
Numeric status code, 201: Created.
Definition: HttpURLConnection.h:121
virtual decaf::io::InputStream * getErrorStream() const
Returns an input stream from the server in the case of an error such as the requested file has not be...
Definition: HttpURLConnection.h:297
static const int HTTP_ENTITY_TOO_LARGE
Numeric status code, 413: Entity too large.
Definition: HttpURLConnection.h:126
Class URL represents a Uniform Resource Locator, a pointer to a "resource" on the World Wide Web...
Definition: URL.h:118
static const int HTTP_NOT_ACCEPTABLE
Numeric status code, 406: Not acceptable.
Definition: HttpURLConnection.h:176
static const int HTTP_BAD_GATEWAY
Numeric status code, 502: Bad Gateway.
Definition: HttpURLConnection.h:96
static const int HTTP_INTERNAL_ERROR
Numeric status code, 500: Internal error.
Definition: HttpURLConnection.h:146
static const int HTTP_USE_PROXY
Numeric status code, 305: Use proxy.
Definition: HttpURLConnection.h:241