T
- the generic typepublic interface ServiceCall<T>
Modifier and Type | Method and Description |
---|---|
ServiceCall<T> |
addHeader(String name,
String value)
Add a header to the request before executing.
|
void |
cancel()
Cancel the current request if possible.
|
void |
enqueue(ServiceCallback<T> callback)
Asynchronous request with added HTTP information.
|
Response<T> |
execute()
Synchronous request.
|
io.reactivex.Single<Response<T>> |
reactiveRequest()
Reactive request using the RxJava 2 library.
|
ServiceCall<T> addHeader(String name, String value)
name
- the name of the headervalue
- the value of the headerResponse<T> execute() throws RuntimeException
RuntimeException
- the exception from HTTP requestvoid enqueue(ServiceCallback<T> callback)
callback
- the callbackio.reactivex.Single<Response<T>> reactiveRequest()
void cancel()
Copyright © 2020. All rights reserved.