Questions tagged [retrofit2.6]

55 questions
0
votes
2 answers

Android RecyclerView with Retrofit and Picasso, image not loading in views blank screen showing

I have a recycler view in which I am trying to load data from a url using retrofit and loading images in recycler view using Picasso library. I don't know everything looks fine to me, I logged the incoming data it is showing in logcat, but it is not…
0
votes
1 answer

how get json by retrofit2 in kotlin

I use retrofit2 to connect to an api and receive data The data is nested D/OkHttp: {"success":{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9}} If the data is as in the example above, it will be received without any problems But if it is as follows,…
0
votes
1 answer

Retrofit POST nested object

i want to ask a question about using Retrofit 2 POST with Kotlin this is the input that Postman does "assets": { "product": [ { "eTag": "\"a59d9f11f3bfc643b00a96cabb8127a6\"", "location":…
0
votes
0 answers

How to send the multiple jsonobjects inside the JSONArray to the api using retrofit android

My Format { "iList": [ { "ADDRESS1": "string", "CITY": "string", "COUNTRY": "string", "EMAIL_ADDRESS": "string", "FIRST_NAME": "string", "LAST_NAME": "string", …
vijju
  • 462
  • 9
  • 30
0
votes
1 answer

How to make a request with a param using Retrofit and coroutines

Im new to coroutines and Im trying to figure out how to make a simple request using retrofit, where I can pass my custom param. All the examples which praise how simple it is use either hardcoded query parameter or make calls which don't use them at…
shtas
  • 499
  • 2
  • 17
0
votes
1 answer

trying to make a login page by using retrofit library and rest API in android studio with login API but login failed

package com.example.androidapp; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.text.TextUtils; import android.util.Log; import…
0
votes
0 answers

Making asynchronous api call resulting unexpected responses but while doing synchronous returns expected response

Hi I am making synchronous API call using retrofit one by one these APIs return results successfully. But while I am trying to asynchronously the APIs sometimes return exact response but sometimes an error. We are passing auth_key in the header. So…
0
votes
1 answer

Retrofit 2.3 Handling SocketTimeoutException

I'm currently using Retrofit 2.3 and RxAndroid for Android as my network communications. Its working fine most of the time. But sometimes, I get a SocketTimeOut exception (I'm assuming due to issues with the internet). I want to be able to handle…
0
votes
1 answer

How to wrap a retrofit response in JAVA?

I have to use a backend that returns me this: { "ok": true, "data": [ { "id": 0, "name": "Intempestivo" }, { "id": 1, "name": "Vacaciones" } } But other times…
renatojobal
  • 45
  • 1
  • 7
0
votes
1 answer

How to implement custom error handling with retroift2

I calling to the api with the basic retrofit Call object: public interface dataApi { @GET("animal/cats") Call getAllData( @Query("api_key") String apiKey ); } And I can get the response inside my view model like…
Noam
  • 485
  • 1
  • 7
  • 18
0
votes
3 answers

addInterceptor intercept NullPointException. in Retrofit2

I got this error: Fatal Exception: kotlin.KotlinNullPointerException com.example.manager.helper.my_api.MyServiceGenerator$createService$$inlined$-addInterceptor$1.intercept (Interceptor.kt:81) okhttp3.internal.http.RealInterceptorChain.proceed…
c-an
  • 3,543
  • 5
  • 35
  • 82
0
votes
0 answers

Android 9 having problems while uploading Images using Retrofit multipart?

I am using Retrofot2.x for the multipart purpose to upload images and as well as username, password with that but it's not working in pie OS My Code is working fine for marshmallow and Nougat devices but not working with pie it just shows this in…
Chandela
  • 262
  • 5
  • 18
0
votes
1 answer

Only one HTTP method is allowed. Found GET and PUT

java.lang.IllegalArgumentException: Only one HTTP method is allowed. Found: GET and PUT. for method ApiInterface.UpdateCoordinates i have tried for the last 2 hours to update the coordinates but it ain't working keeps throwing this…
0
votes
1 answer

java.lang.RuntimeException: Unable to invoke no-args constructor for retrofit2.Call

Registering an InstanceCreator with Gson for this type may fix this problem. Can some help me? I need to capture headers(Authorization Token) from Response. val call: Call = api.getGuestAuthToken(AuthModel("guest")) call.enqueue(object…
Sri
  • 1
  • 1
  • 3
0
votes
0 answers

Choosing file using Intent.ACTION_OPEN_DOCUMENT and uploading to server using Retrofit2

There are some related questions about choosing and uploading files from Android. But those answers are outdated and most of the methods in those responses are gone/deprecated. I am trying to get a file from the local storage using…
zoha131
  • 1,758
  • 2
  • 16
  • 18