retrofit2 Questions

3

Solved

I have a repository that creates a flow where I emit the result of a suspending Retrofit method. This works in the app, but I would like to run tests on the code. I am using kotlinx-coroutines-test...
Pettish asked 4/4, 2022 at 1:33

5

Solved

I am using Retrofit to call my API. I am very new to Retrofit and this is the reason why I am unable to find this error. I send a request to the API, API response is 200 OK but retrofit calls the o...
Redmund asked 5/5, 2017 at 15:51

4

In my Kotlin, Retrofit 2 project: class TransportService { // static analog companion object { @JvmStatic fun checkoutSessions(bodyMap: Map<String, Any>, callback: Callback<Void>)...
Extrinsic asked 1/4, 2019 at 14:36

4

I'm using Retrofit 2 and I need to handle response error in JSON format. Below is the example of the response body. { "success": false, "error": { "message": { "name": [ "This input is requir...
Allegory asked 8/10, 2018 at 19:4

35

Solved

I am trying to consume an API using Retrofit and Jackson to deserialize. I am getting the onFailure error No Creators, like default construct, exist): cannot deserialize from Object value (no deleg...
Wheaten asked 7/11, 2018 at 14:29

2

Solved

in my android app I use Retrofit 2: public enum OperationType { @SerializedName("payment") PAYMENT, @SerializedName("payout") PAYOUT, @SerializedName("transfer") TRANSFER } fun getOperat...
Masaccio asked 6/8, 2019 at 11:48

4

I have this code: val profile: UserProfile = userApi.profile() @GET("users/profile") suspend fun profile(): UserProfile When i run userApi.profile() i get this error: java.lang.Clas...

5

Solved

I'm using Retrofit 2.7.1 with Kotlin coroutines. I have a Retrofit service defined as such: @PUT("/users/{userId}.json") suspend fun updateUserProfile( @Path("userId") userId: String, @Query("d...
Broth asked 7/1, 2020 at 21:19

15

Solved

I can't find relevant methods in the Retrofit API for logging complete request/response bodies. I was expecting some help in the Profiler (but it only offers meta-data about response). I tried sett...
Habakkuk asked 19/2, 2014 at 16:22

9

Solved

Getting null response but code 200 with Release APK when minify enable, when minify false then its ok. But getting expected response with debug APK when minify enable.
Bowerbird asked 14/3, 2017 at 9:36

13

Solved

In my application i want get data from server, for get connect to server i used Retrofit, OkHttp. But when running application, show me force close error. In android api 21+ is not error, but below...
Undue asked 29/6, 2019 at 15:18

3

Solved

I'm trying to process a server response which is GZIP'd. The response comes with a header Content-Type: application/x-gzip but does not have header Content-Encoding: gzip If I add that heade...
Baccarat asked 19/5, 2016 at 20:33

8

I added a new Retrofit interface to my project containing a couple of Endpoints annotated with the @GET and @HEADERS annotations, after Injecting said interface to a repository class using the @Inj...
Fakir asked 6/2, 2019 at 23:40

4

I have an android .aar library built and I am trying to integrate it with one of the projects. When the app tries to open the initial screen of the .aar library where I have API call using retrofit...
Nitz asked 11/7, 2019 at 12:46

5

Solved

I try to upload an image from an Android App to a Django server using Retrofit 2 and OkHttp3. For that, I used to create a RequestBody instance using the following lines: RequestBody requestImageF...
Tenne asked 1/11, 2019 at 14:11

3

Solved

I have a project with Kotlin coroutines and Retrofit. I had these dependencies: implementation 'com.squareup.retrofit2:retrofit:2.5.0' implementation 'com.squareup.retrofit2:converter-gson:2.5.0'...
Oxidize asked 6/6, 2019 at 8:21

3

Solved

I'm posting content to the server in a multipart/form-data request. and the data I'm posting contains multiple parameters including a file array parameter (files[]). Using postman I'm setting the ...
Wifely asked 17/12, 2016 at 1:27

4

Solved

How can I parse JSON to model with enum? Here is my enum class: enum class VehicleEnumEntity(val value: String) { CAR("vehicle"), MOTORCYCLE("motorcycle"), VAN("van"), MOTORHOME("motorhome"),...
Dialogue asked 7/8, 2017 at 18:18

14

Solved

I am trying to do a HTTP POST to server using Retrofit 2.0 MediaType MEDIA_TYPE_TEXT = MediaType.parse("text/plain"); MediaType MEDIA_TYPE_IMAGE = MediaType.parse("image/*"); ByteArrayOutputStrea...
Trixi asked 2/1, 2016 at 5:31

1

Solved

I am experimenting with network traffic inspector, a new feature of Android Studio Flamingo. I'm trying to change the status code of a response with a status code of 400 to 200. During the rule add...
Luralurch asked 20/6, 2023 at 19:8

6

Solved

I followed this to POST Data Using Retrofit2 I Used JSON POJO to Parse my POST and GET files So Here If Data inside the Records Is there I will get This Kind of Response { "status": "200", "resp...
Uphemia asked 9/7, 2018 at 4:13

5

Solved

I'm using Retrofit to integrate my Web services and I do not understand how to send a JSON object to the server using a POST request. I'm currently stuck, here is my code: Activity:- @Override pr...
Wampumpeag asked 26/11, 2016 at 10:29

5

Solved

I'm trying to get just string request but it's give error like this Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $ And my API output is like this : { "status": true, "me...
Haunt asked 17/1, 2018 at 8:49

1

I know that it was a work in progress and it was supposed to become a thing in version 2.1, which is the latest version. So, is it a thing ready now? Couldn't find any info on that topic. And if...
Diminutive asked 9/8, 2016 at 16:9

4

I am trying to retrieve Cookies values from API response for maintaining the backend session by setting cookie value to new API call in case the APP is closed : The response to API call from PostM...
Commit asked 4/1, 2018 at 7:20

© 2022 - 2025 — McMap. All rights reserved.