Package com.twilio.http
Class HttpClient
- java.lang.Object
-
- com.twilio.http.HttpClient
-
- Direct Known Subclasses:
NetworkHttpClient
,ValidationClient
public abstract class HttpClient extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
ANY_100
static int
ANY_200
static int
ANY_300
static int
ANY_400
static int
ANY_500
static int
CONNECTION_TIMEOUT
static org.apache.http.client.config.RequestConfig
DEFAULT_REQUEST_CONFIG
static org.apache.http.config.SocketConfig
DEFAULT_SOCKET_CONFIG
static long
DELAY_MILLIS
static int
RETRIES
static int[]
RETRY_CODES
static int
SOCKET_TIMEOUT
-
Constructor Summary
Constructors Constructor Description HttpClient()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Response
makeRequest(Request request)
Response
reliableRequest(Request request)
Make a request.Response
reliableRequest(Request request, int[] retryCodes, int retries, long delayMillis)
Make a request.
-
-
-
Field Detail
-
CONNECTION_TIMEOUT
public static final int CONNECTION_TIMEOUT
- See Also:
- Constant Field Values
-
SOCKET_TIMEOUT
public static final int SOCKET_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_REQUEST_CONFIG
public static final org.apache.http.client.config.RequestConfig DEFAULT_REQUEST_CONFIG
-
DEFAULT_SOCKET_CONFIG
public static final org.apache.http.config.SocketConfig DEFAULT_SOCKET_CONFIG
-
ANY_500
public static final int ANY_500
- See Also:
- Constant Field Values
-
ANY_400
public static final int ANY_400
- See Also:
- Constant Field Values
-
ANY_300
public static final int ANY_300
- See Also:
- Constant Field Values
-
ANY_200
public static final int ANY_200
- See Also:
- Constant Field Values
-
ANY_100
public static final int ANY_100
- See Also:
- Constant Field Values
-
RETRY_CODES
public static final int[] RETRY_CODES
-
RETRIES
public static final int RETRIES
- See Also:
- Constant Field Values
-
DELAY_MILLIS
public static final long DELAY_MILLIS
- See Also:
- Constant Field Values
-
-
Method Detail
-
reliableRequest
public Response reliableRequest(Request request)
Make a request.- Parameters:
request
- request to make- Returns:
- Response of the HTTP request
-
reliableRequest
public Response reliableRequest(Request request, int[] retryCodes, int retries, long delayMillis)
Make a request.- Parameters:
request
- request to makeretryCodes
- codes used for retriesretries
- max number of retriesdelayMillis
- delays between retries- Returns:
- Response of the HTTP request
-
-