public class HttpUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpUtils.HttpMethod |
| Constructor and Description |
|---|
HttpUtils() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.http.impl.client.CloseableHttpClient |
getDefaultClient(HttpConfiguration httpConfiguration)
Get a default HttpClient based on the HttpConfiguration object.
|
static <T,U extends Response<U>> |
sendGetMessage(Request<T,U> request,
String accessToken,
org.apache.http.client.HttpClient httpClient,
HttpConfiguration httpConfiguration)
Internal Use.
|
static <T,U extends Response<U>> |
sendPostMessage(Request<T,U> request,
String accessToken,
org.apache.http.client.HttpClient httpClient,
HttpConfiguration httpConfiguration)
Internal Use.
|
static <T,U extends Response<U>> |
sendPutMessage(Request<T,U> request,
String accessToken,
org.apache.http.client.HttpClient httpClient,
HttpConfiguration httpConfiguration)
Internal Use.
|
public static org.apache.http.impl.client.CloseableHttpClient getDefaultClient(HttpConfiguration httpConfiguration)
HttpConfiguration object.httpConfiguration - An HttpConfiguration for this API clientpublic static <T,U extends Response<U>> U sendPostMessage(Request<T,U> request, String accessToken, org.apache.http.client.HttpClient httpClient, HttpConfiguration httpConfiguration)
HttpConfiguration, and will
throw a FireException if HTTP is used when only HTTPS is allowed. A FireException
is also thrown if the response from Fire is not success (ie. if it's not 200 status code).T - the class of the request objectU - the class of the response objectrequest - a prepared request to sendaccessToken - the accessToken to use.httpClient - the HttpClient to use.httpConfiguration - the HttpConfiguration to use.public static <T,U extends Response<U>> U sendPutMessage(Request<T,U> request, String accessToken, org.apache.http.client.HttpClient httpClient, HttpConfiguration httpConfiguration)
HttpConfiguration, and will
throw a FireException if HTTP is used when only HTTPS is allowed. A FireException
is also thrown if the response from Fire is not success (ie. if it's not 200 status code).T - the class of the request objectU - the class of the response objectrequest - a prepared request to sendaccessToken - the accessToken to use.httpClient - the HttpClient to use.httpConfiguration - the HttpConfiguration to use.public static <T,U extends Response<U>> U sendGetMessage(Request<T,U> request, String accessToken, org.apache.http.client.HttpClient httpClient, HttpConfiguration httpConfiguration)
HttpConfiguration, and will
throw a FireException if HTTP is used when only HTTPS is allowed. A FireException
is also thrown if the response from Fire is not success (ie. if it's not 200 status code).T - the class of the request objectU - the class of the response objectrequest - a prepared request to sendaccessToken - the accessToken to use.httpClient - the HttpClient to use.httpConfiguration - the HttpConfiguration to use.Copyright © 2019. All rights reserved.