18#ifndef _DECAF_NET_HTTPURLCONNECTION_H_
19#define _DECAF_NET_HTTPURLCONNECTION_H_
41 class DECAF_API HttpURLConnection :
public URLConnection {
265 static bool followRedirects;
267 static const int DEFAULT_CHUNK_LENGTH;
271 HttpURLConnection(
const HttpURLConnection&);
272 HttpURLConnection& operator= (
const HttpURLConnection&);
397 return followRedirects;
408 followRedirects = follow;
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_FORBIDDEN
Numeric status code, 403: Forbidden.
Definition HttpURLConnection.h:131
static const int HTTP_INTERNAL_ERROR
Numeric status code, 500: Internal error.
Definition HttpURLConnection.h:146
static const int HTTP_ENTITY_TOO_LARGE
Numeric status code, 413: Entity too large.
Definition HttpURLConnection.h:126
virtual ~HttpURLConnection()
static const int HTTP_BAD_REQUEST
Numeric status code, 400: Bad Request.
Definition HttpURLConnection.h:106
static const int HTTP_CLIENT_TIMEOUT
Numeric status code, 408: Client Timeout.
Definition HttpURLConnection.h:111
int getResponseCode()
Returns the response code returned by the remote HTTP server.
static const int HTTP_PROXY_AUTH
Numeric status code, 407: Proxy authentication required.
Definition HttpURLConnection.h:221
static const int HTTP_BAD_GATEWAY
Numeric status code, 502: Bad Gateway.
Definition HttpURLConnection.h:96
static const int HTTP_NO_CONTENT
Numeric status code, 204: No content.
Definition HttpURLConnection.h:171
static const int HTTP_NOT_IMPLEMENTED
Numeric status code, 501: Not implemented.
Definition HttpURLConnection.h:191
bool instanceFollowRedirects
Flag to define whether the protocol will automatically follow redirects or not.
Definition HttpURLConnection.h:70
std::string method
The HTTP request method of this HttpURLConnection.
Definition HttpURLConnection.h:47
static const int HTTP_OK
Numeric status code, 200: OK.
Definition HttpURLConnection.h:201
static const int HTTP_LENGTH_REQUIRED
Numeric status code, 411: Length required.
Definition HttpURLConnection.h:151
int responseCode
The status code of the response obtained from the HTTP request.
Definition HttpURLConnection.h:59
static const int HTTP_UNSUPPORTED_TYPE
Numeric status code, 415: Unsupported type.
Definition HttpURLConnection.h:251
void setFixedLengthStreamingMode(int contentLength)
If the length of a HTTP request body is known ahead, sets fixed length to enable streaming without bu...
static const int HTTP_MOVED_PERM
Numeric status code, 301 Moved permanently.
Definition HttpURLConnection.h:156
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_USE_PROXY
Numeric status code, 305: Use proxy.
Definition HttpURLConnection.h:241
static const int HTTP_PAYMENT_REQUIRED
Numeric status code, 402: Payment required.
Definition HttpURLConnection.h:211
static const int HTTP_CONFLICT
Numeric status code, 409: Conflict.
Definition HttpURLConnection.h:116
static const int HTTP_MOVED_TEMP
Numeric status code, 302: Moved temporarily.
Definition HttpURLConnection.h:161
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
void setInstanceFollowRedirects(bool followRedirects)
Sets whether this connection follows redirects.
Definition HttpURLConnection.h:358
static const int HTTP_PRECON_FAILED
Numeric status code, 412: Precondition failed.
Definition HttpURLConnection.h:216
static const int HTTP_NOT_MODIFIED
Numeric status code, 304: Not modified.
Definition HttpURLConnection.h:196
int chunkLength
If the HTTP chunked encoding is enabled this parameter defines the chunk-length.
Definition HttpURLConnection.h:77
static const int HTTP_NOT_FOUND
Numeric status code, 404: Not found.
Definition HttpURLConnection.h:186
static const int HTTP_UNAVAILABLE
Numeric status code, 503: Unavailable.
Definition HttpURLConnection.h:256
std::string responseMessage
The HTTP response message which corresponds to the response code.
Definition HttpURLConnection.h:64
static const int HTTP_ACCEPTED
Numeric status code, 202: Accepted.
Definition HttpURLConnection.h:91
std::string getResponseMessage()
Returns the response message returned by the remote HTTP server.
static const int HTTP_SEE_OTHER
Numeric status code, 303: See other.
Definition HttpURLConnection.h:236
static const int HTTP_CREATED
Numeric status code, 201: Created.
Definition HttpURLConnection.h:121
int fixedContentLength
If using HTTP fixed-length streaming mode this parameter defines the fixed length of content.
Definition HttpURLConnection.h:84
static const int HTTP_UNAUTHORIZED
Numeric status code, 401: Unauthorized.
Definition HttpURLConnection.h:246
static const int HTTP_GATEWAY_TIMEOUT
Numeric status code, 504: Gateway timeout.
Definition HttpURLConnection.h:136
virtual void disconnect()=0
Closes the connection to the HTTP server.
static const int HTTP_VERSION
Numeric status code, 505: Version not supported.
Definition HttpURLConnection.h:261
static const int HTTP_NOT_AUTHORITATIVE
Numeric status code, 203: Not authoritative.
Definition HttpURLConnection.h:181
static const int HTTP_NOT_ACCEPTABLE
Numeric status code, 406: Not acceptable.
Definition HttpURLConnection.h:176
static const int HTTP_GONE
Numeric status code, 410: Gone.
Definition HttpURLConnection.h:141
static const int HTTP_BAD_METHOD
Numeric status code, 405: Bad Method.
Definition HttpURLConnection.h:101
HttpURLConnection(const URL &url)
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_RESET
Numeric status code, 205: Reset.
Definition HttpURLConnection.h:231
static const int HTTP_PARTIAL
Numeric status code, 206: Partial.
Definition HttpURLConnection.h:206
static const int HTTP_REQ_TOO_LONG
Numeric status code, 414: Request too long.
Definition HttpURLConnection.h:226
static const int HTTP_MULT_CHOICE
Numeric status code, 300: Multiple choices.
Definition HttpURLConnection.h:166
bool getInstanceFollowRedirects() const
Returns whether this connection follows redirects.
Definition HttpURLConnection.h:348
void setRequestMethod(const std::string &method)
Sets the request command which will be sent to the remote HTTP server.
void setChunkedStreamingMode(int chunklen)
If the length of a HTTP request body is NOT known ahead, enable chunked transfer encoding to enable s...
URL url
Definition URLConnection.h:52
Class URL represents a Uniform Resource Locator, a pointer to a "resource" on the World Wide Web.
Definition URL.h:118
#define NULL
Definition Config.h:33
#define DECAF_API
Definition Config.h:29
Definition URLStreamHandlerManager.h:26
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25