Package ru.cwcode.tkach.httpWrapper
Class ServiceClient
java.lang.Object
ru.cwcode.tkach.httpWrapper.ServiceClient
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final com.google.gson.Gsonprotected final LinkedHashMap<String,String> static final okhttp3.MediaTypeprotected final okhttp3.OkHttpClient -
Constructor Summary
ConstructorsConstructorDescriptionServiceClient(okhttp3.OkHttpClient okHttpClient, com.google.gson.Gson gson, String baseUrl) -
Method Summary
Modifier and TypeMethodDescriptionvoid<T extends BaseRequest<T,R>, R extends BaseResponse<R>>
CompletableFuture<R>sendRequest(T request)
-
Field Details
-
JSON_UTF8
public static final okhttp3.MediaType JSON_UTF8 -
okHttpClient
protected final okhttp3.OkHttpClient okHttpClient -
gson
protected final com.google.gson.Gson gson -
baseUrl
-
headers
-
-
Constructor Details
-
ServiceClient
-
-
Method Details
-
addHeader
-
sendRequest
public <T extends BaseRequest<T,R>, CompletableFuture<R> sendRequestR extends BaseResponse<R>> (T request)
-