Questions tagged [retrofit2.6]

55 questions
0
votes
1 answer

Image Upload using Retrofit in Android

I am trying to upload an image to the Webserver using retrofit. The API has been developed using Dot Net. The API is working fine on postman but shows error in android. URL:…
Wasif
  • 61
  • 10
0
votes
2 answers

HTTP Request return "Bad Request" (code 400) in android app but works on postman (code 200)

I have a API on android app and it worked for long time. System get updated and now I'm getting "400 - Bad Request" in the same request (without changes). But in Postman or Advanced REST Client works well. I'm using: Java Android Retrofit…
Lucas Correa
  • 87
  • 2
  • 9
0
votes
1 answer

How to get file size using retrofit 2 . I tried by return -1?

I want to build App to download file with progress-bar and I tried to get file size from server. while using retrofit 2 library but failed to get the total-file size. and return -1, i tested its work on build:gradle:3.0.1 but not in…
Attaullah
  • 3,856
  • 3
  • 48
  • 63
0
votes
2 answers

How to POST a List as Body in Retrofit 2.6

Already searched a lot but couldn't find an appropriate answer. I have the following JSON. I understand this is a List object. How do I send a POST request as @Body in retrofit 2? Also, what is the POJO that I need to have to get a successful…
AniV
  • 3,997
  • 1
  • 12
  • 17
0
votes
1 answer

Can't avoid manual cast

Retrofit 2.6. @GET("/event") suspend fun getEvents(@Query("orgn") base: Int, @Query("event") quote: Int): Response> In service: import retrofit2.Response suspend fun getEvents( orgn: Int, event: Int, …
Alexei
  • 14,350
  • 37
  • 121
  • 240
0
votes
3 answers

Can't execute Retrofit sync operation by Kotlin

In my android app: app/build.gradle implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0' implementation "com.squareup.retrofit2:converter-gson:2.6.0" implementation "com.squareup.retrofit2:retrofit:2.6.0" In my interface: import…
Alexei
  • 14,350
  • 37
  • 121
  • 240
0
votes
1 answer

Retrofit post a object parameter, but receive a "parameter is not present" error

Here is my spring boot controller: @RestController @RequestMapping("/api/v1/geo-media/") class GeoMediaController { @PostMapping("create") fun saveMedias(@RequestHeader("token") token: String, @RequestParam mediaGroup:…
boybeak
  • 417
  • 5
  • 19
0
votes
1 answer

How to correctly use suspend fun in Retrofit 2.6.0 coroutines with kotlin

I'm trying to write my network request to use Retrofit 2.6.0 and coroutines suspend fun. But i keep getting null object. This is the first time am trying retrofit 2.6 and coroutines here is my sample code Data class data class ProjectList (val…
Kennan Obura
  • 315
  • 1
  • 4
  • 14
0
votes
1 answer

Need to get a string from response returned by api using retrofit2

I am trying to get string value returned by API on success. I am getting success but I do not getting the required value in the response, but when I navigate to response-> body-> responseBody then it shows me that value but I am unable to get that…
-1
votes
1 answer

Problem in get data on using retrofit2 on newer Android

I am using retrofit2 in kotlin to connect to the api I get data from API without any problems in Android API 22 But when I test the same program on Android API 30, it gives me the following answer and does not return any value in the API…
1 2 3
4