8,571
questions
2
votes
0
answers
14
views
Retrofit post api with multipart list
As we can send list of Request body to api call in retrofit like below
@POST("task/updatedropoff")
@Multipart
fun taskUpdateDropOff(
@Header("apikey") token: String,...
0
votes
0
answers
20
views
How to display .pdf response from API in Android jetpack compose [closed]
I want to display pdf. From api I'm getting response as .pdf format
I was trying to convert to base 64. Couldn't find a proper solution
Content disposition : .pdf
I think we cannot proceed with native ...
0
votes
0
answers
25
views
com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonObject but was com.google.gson.JsonNull
var retrofitResponse: RetrofitResponse<APIResponse<User>>? = null
withContext(Dispatchers.IO) {
retrofitResponse = try {
val response = ...
0
votes
1
answer
22
views
How to remove a header set using plugin for a particular API request in KTOR
I have created a custom plugin to set headers for requests in ktor
internal fun headersPlugin(defaultHeaders: DefaultHeaders) = createClientPlugin("headersPlugin") {
onRequest { request, ...
1
vote
1
answer
23
views
Different query results when re-executing with Retrofit in Android Studio
I am writing a book search application. In it I created a Retrofit service to fetch data from Google Books API.
When I query with q=domani multiple times the query result is sometimes different each ...
1
vote
0
answers
26
views
Retrofit OkHttp with Moshi: Gzip Encoding Error
I'm using Retrofit with OkHttp and Moshi. I have to add the "Accept-Encoding":"gzip, deflate, br" header myself. But OkHttp adds its own "Accept-Encoding" header.
Due to ...
1
vote
2
answers
43
views
How to change root of JSON response before cast to typed entity?
Task
The remote server returns a response with a body:
{
done: true,
response: {
result: {
// data
}
}
}
In case of an error, a response with 200 status and a ...
0
votes
0
answers
25
views
TimeOut not happening even after adding CustomTimeoutInterceptor and calling withConnectTimeout
My whole intention is to add a timeout on a particular request.
For that I have added a CustomTimeoutInterceptor which has similar kind of code as stated below.
Even after setting timeout by calling ...
0
votes
0
answers
17
views
Moshi and annotation @field:Json(name="some_field") and Json(name="some_field")
After upgrading retrofit to version 2.11.0 and moshi to version 1.15.1, everything broke for me. Previously, I used the annotation @field:Json(name="some_field") in models. But now for ...
0
votes
0
answers
24
views
retrofit multipart form data in flutter web
when i am using my flutter project on desktop/mobile i can use File from 'dart:io' in my request like this
@MultiPart()
@POST("v1/images/upload")
Future<UploadImageResponse> ...
0
votes
0
answers
22
views
Downloading larger file in flutter using retrofit api call?
I'm trying to download some media or file from backend using retrofit api calling in flutter. But after sometime it show out of memory and default get connection time out.there is some solution ...
0
votes
0
answers
20
views
java.lang.IllegalStateException: Observable return type must be parameterized as Observable<Foo> or Observable<? extends Foo>
I have this DataManagerClass.kt in my app that causes crashes only in release build. The crash states something like this:
import com.viva.yag.source.remote.retrofit.ApiService
import com.viva.yag....
1
vote
0
answers
31
views
How to extract URL from HTML response in Android?
I have @GET endpoint in response to which I receive an html code with URLs. I need to reach the URL that comes after 200 code. Do you have any idea how to do it in Android?
I already tried to use the ...
-1
votes
0
answers
28
views
How to troubleshoot 400 Bad Request Retrofit
I'm using Kotlin and Retrofit to get fetch data from server. I have tested everything and it works fine for me. but sometimes my client got Error Bad Request and I don't know how to give the solution ...
0
votes
0
answers
33
views
PDF file with blank pages created from ResponseBody
I ran into a problem downloading a PDF file: it is saved with blank pages
My Get request, that returns pdf
@GET("/")
suspend fun getSomePdf(
@Query("someQueryParameter") ...