-
- All Implemented Interfaces:
public final class HttpClientKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any> Try<T, HttpException>fetchWithDecoder(HttpClient $self, HttpRequest request, Function1<HttpFetchResponse, T> decoder)Fetches the resource from the given request before decoding it with the provided decoder. final static Try<String, HttpException>fetchString(HttpClient $self, HttpRequest request, Charset charset)Fetches the resource from the given request as a String. final static Try<JSONObject, HttpException>fetchJSONObject(HttpClient $self, HttpRequest request)Fetches the resource from the given request as a JSONObject. -
-
Method Detail
-
fetchWithDecoder
final static <T extends Any> Try<T, HttpException> fetchWithDecoder(HttpClient $self, HttpRequest request, Function1<HttpFetchResponse, T> decoder)
Fetches the resource from the given request before decoding it with the provided decoder.
If the decoder fails, a MalformedResponse error is returned.
-
fetchString
final static Try<String, HttpException> fetchString(HttpClient $self, HttpRequest request, Charset charset)
Fetches the resource from the given request as a String.
-
fetchJSONObject
final static Try<JSONObject, HttpException> fetchJSONObject(HttpClient $self, HttpRequest request)
Fetches the resource from the given request as a JSONObject.
-
-
-
-