kittinunf
03/31/2020, 5:59 AMkittinunf
03/31/2020, 6:00 AMitnoles
03/31/2020, 6:06 AMitnoles
03/31/2020, 6:07 AMNikky
03/31/2020, 10:10 PMkittinunf
04/01/2020, 5:15 AMkittinunf
04/01/2020, 5:15 AMitnoles
04/01/2020, 7:18 AMitnoles
04/03/2020, 4:19 AMitnoles
04/03/2020, 4:36 AMkittinunf
04/03/2020, 7:24 AMitnoles
04/03/2020, 8:17 PMLeoColman
05/11/2020, 11:33 PMkittinunf
05/12/2020, 6:06 AM.timeout
and .timeoutRead
, you can also configure them globally with FuelManager
kittinunf
05/12/2020, 6:06 AMitnoles
06/16/2020, 5:58 AMMarcin Wisniowski
06/16/2020, 8:40 PMcurl --interface 10.10.0.8 <https://example.com>
or
wget --bind-address=10.10.0.8 <https://example.com>
I'm sending requests from a server that has multiple network interfaces and I'm unable to find how to make Fuel send the request from the one I want.itnoles
06/29/2020, 3:01 AMNikky
06/29/2020, 9:50 AMStefan Beyer
06/29/2020, 1:07 PMclass User(val id: Int, val name: String, val username: String)
data class Page<T : Any>(val elements: List<T>, val page: Int, val totalPages: Int)
inline fun <reified T : Any> requestSingle(page: Int): Page<T> {
val (request, response, result) = Fuel
.get("<https://jsonplaceholder.typicode.com/users>")
.header(Headers.ACCEPT, "application/json")
.responseObject<List<T>>()
return Page(result.get(), page, 3) // simulate 3 pages
}
inline fun <reified T : Any> requestAll(): List<T> {
val firstPage = requestSingle<T>(1)
val allElements = firstPage.elements.toMutableList()
for (i in 2..firstPage.totalPages) allElements += requestSingle<T>(i).elements
return allElements
}
println(requestAll<User>()) // getting a List<Map<String, Any>> instead of List<User>
Is there a sensible workaround for this with fuel, or do I need to use resultString
and parse it manually with a manually configured deserializer ?Nikky
08/04/2020, 8:30 AMRobert Jaros
08/25/2020, 2:40 PMNikky
08/25/2020, 2:44 PMkittinunf
08/26/2020, 1:50 AMitnoles
09/11/2020, 11:43 PMNikky
09/13/2020, 3:51 PMkittinunf
09/14/2020, 3:40 AMkittinunf
09/14/2020, 3:40 AMYamila Gammeri
09/21/2020, 10:47 AMnetworkService.fuelManager.request(BTXInteractApi.GetLegal()).awaitObjectResult<LegalModel>(kotlinxDeserializerOf(json = networkService.json()))
, I was wondering how I could check the HTTP status code and then decode the response into another model based on this.
2. The API I’m using requires the use of an access token + refresh token, is it possible to configure fuel such that I can intercept a failed auth request and then update the session using the access token? E.g. a request is made, server responds with 401, another request is made to refresh session, original request is sent again, response is receivedLeoColman
10/27/2020, 7:34 PM"x".httpGet().responseString()
and get it as a string