public class ApiClientUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
beforeSend(String url,
Map<String,String> headerParametersWithStringTypeValue,
com.laserfiche.api.client.httphandlers.HttpRequestHandler httpRequestHandler)
Sets the authorization bearer token and returns a Request Url.
|
protected static com.laserfiche.api.client.model.ApiException |
createApiException(kong.unirest.HttpResponse<?> httpResponse,
com.laserfiche.api.client.model.ProblemDetails problemDetails) |
static Map<String,String> |
getHeadersMap(kong.unirest.Headers headers)
Returns a Header Map containing the header name and value.
|
protected static Map<String,Object> |
getParametersWithNonDefaultValue(String[] parameterTypes,
String[] parameterNames,
Object[] parameterValues) |
static boolean |
isRetryableStatusCode(int statusCode,
kong.unirest.HttpMethod requestMethod)
Returns a boolean value that determines whether or not to re-send the same API request.
|
static String |
mergeMaxSizeIntoPrefer(int maxSize,
String prefer)
Returns a combined header string contain the prefer and maxSize String.
|
static <TResponse> |
sendRequestWithRetry(kong.unirest.UnirestInstance httpClient,
com.laserfiche.api.client.httphandlers.HttpRequestHandler httpRequestHandler,
String url,
String requestMethod,
String contentType,
Object requestBody,
String queryStringFields,
Collection<?> queryStringFieldList,
Map<String,Object> queryParameters,
Map<String,Object> pathParameters,
Map<String,String> headerParametersWithStringTypeValue,
boolean isDynamicFieldValues,
Function<kong.unirest.HttpResponse<Object>,TResponse> parseResponse) |
protected static com.laserfiche.api.client.model.ApiException createApiException(kong.unirest.HttpResponse<?> httpResponse,
com.laserfiche.api.client.model.ProblemDetails problemDetails)
public static String beforeSend(String url, Map<String,String> headerParametersWithStringTypeValue, com.laserfiche.api.client.httphandlers.HttpRequestHandler httpRequestHandler)
url - The url.headerParametersWithStringTypeValue - The header parameters with string type value.httpRequestHandler - The HTTP request handler.public static Map<String,String> getHeadersMap(kong.unirest.Headers headers)
headers - The headers.public static boolean isRetryableStatusCode(int statusCode,
kong.unirest.HttpMethod requestMethod)
statusCode - The status code.requestMethod - The HTTP request method.public static String mergeMaxSizeIntoPrefer(int maxSize, String prefer)
prefer - The prefer header.maxSize - The max size header number.protected static Map<String,Object> getParametersWithNonDefaultValue(String[] parameterTypes, String[] parameterNames, Object[] parameterValues)
public static <TResponse> TResponse sendRequestWithRetry(kong.unirest.UnirestInstance httpClient,
com.laserfiche.api.client.httphandlers.HttpRequestHandler httpRequestHandler,
String url,
String requestMethod,
String contentType,
Object requestBody,
String queryStringFields,
Collection<?> queryStringFieldList,
Map<String,Object> queryParameters,
Map<String,Object> pathParameters,
Map<String,String> headerParametersWithStringTypeValue,
boolean isDynamicFieldValues,
Function<kong.unirest.HttpResponse<Object>,TResponse> parseResponse)
Copyright © 2025. All rights reserved.