public interface NetworkService
Modifier and Type | Interface and Description |
---|---|
static class |
NetworkService.Factory
Factory class for getting instances of
NetworkService implementations. |
Modifier and Type | Method and Description |
---|---|
<T> T |
request(IRequest request,
com.kakao.network.response.ResponseStringConverter<T> converter)
Sends a network request synchronously.
|
<T,E extends Exception> |
request(IRequest request,
com.kakao.network.response.ResponseStringConverter<T> converter,
com.kakao.network.response.CustomErrorConverter<E> errorConverter)
Sends a network request with custom error converter.
|
<T,E extends Exception> |
request(IRequest request,
com.kakao.network.response.ResponseStringConverter<T> converter,
com.kakao.network.response.CustomErrorConverter<E> errorConverter,
ResponseCallback<T> callback)
Sends a network request asynchronously with custom error converter.
|
<T> Future<T> |
request(IRequest request,
com.kakao.network.response.ResponseStringConverter<T> converter,
ResponseCallback<T> callback)
Sends a network request asynchronously.
|
<T> List<T> |
requestList(IRequest request,
com.kakao.network.response.ResponseStringConverter<T> converter)
Sends a network request that expects an array response.
|
<T> Future<List<T>> |
requestList(IRequest request,
com.kakao.network.response.ResponseStringConverter<T> converter,
ResponseCallback<List<T>> callback)
Asynchronous version of
requestList(IRequest, ResponseStringConverter) . |
<T> T request(IRequest request, com.kakao.network.response.ResponseStringConverter<T> converter) throws IOException, com.kakao.network.response.ResponseBody.ResponseBodyException, com.kakao.network.response.ApiResponseStatusError
T
- Response Typerequest
- IRequest
object that represents API requestsconverter
- String converter for Response Type TIOException
- when network failsResponseBody.ResponseBodyException
- when there is an error in the response bodycom.kakao.network.response.ApiResponseStatusError
- when an error is returned from the API server<T,E extends Exception> T request(IRequest request, com.kakao.network.response.ResponseStringConverter<T> converter, com.kakao.network.response.CustomErrorConverter<E> errorConverter) throws IOException, com.kakao.network.response.ResponseBody.ResponseBodyException, E extends Exception
CustomErrorConverter
isntance if
necessary.T
- Response TypeE
- Custom Error typerequest
- IRequest
object that represents API requestsconverter
- String converter for Response Type TerrorConverter
- ResponseBody
Converter for Custom Error Type EIOException
com.kakao.network.response.ResponseBody.ResponseBodyException
E extends Exception
<T,E extends Exception> Future<T> request(IRequest request, com.kakao.network.response.ResponseStringConverter<T> converter, com.kakao.network.response.CustomErrorConverter<E> errorConverter, ResponseCallback<T> callback)
request(IRequest, ResponseStringConverter, CustomErrorConverter)
for further detail.T
- Response TypeE
- Custom Error typerequest
- IRequest
object that represents API requestsconverter
- String converter for Response Type TerrorConverter
- ResponseBody
Converter for Custom Error Type Ecallback
- ResponseCallback
object that will handle either success/failure of API requests<T> Future<T> request(IRequest request, com.kakao.network.response.ResponseStringConverter<T> converter, ResponseCallback<T> callback)
T
- Response Typerequest
- IRequest
object that represents API requestsconverter
- Converter object that will convert ResponseBody into a give Generic type.callback
- Callback that will handle either success/failure of API requests<T> List<T> requestList(IRequest request, com.kakao.network.response.ResponseStringConverter<T> converter) throws IOException
T
- Response Typerequest
- IRequest
object that represents API requestsconverter
- String converter for Response Type TList
IOException
- when network fails<T> Future<List<T>> requestList(IRequest request, com.kakao.network.response.ResponseStringConverter<T> converter, ResponseCallback<List<T>> callback)
requestList(IRequest, ResponseStringConverter)
.T
- Response Typerequest
- IRequest
object that represents API requestsconverter
- String converter for Response Type Tcallback
- ResponseCallback
object that will handle either success/failure of API requests