Category : retrofit

for example: { "error": false, "message": "", "code": "", "ver": "v1.0.0", "base": "https://,,,,,,,,,.com/", "count": 1, "updated": "2020-10-28T19:40:51+03:00", "data": [ { "id": "44", "slug": "human-resources", "name": "Human resources", "img1": null, "img2": "page_44/1560347480_2.jpg", "date": "2019-05-31", "des": "’vvvvvv.v", "sendMail": "[email protected]….", "iframe_url": "ff/ff" } ] } this is api json response. I want only "data": [] value, not the ..

Read more

I try send photo with help CatsAPI. This is link on method upload api. I have an interface : @Headers(value = ["content-type:multipart/form-data;"]) @POST("images/upload") suspend fun uploadImage( @Header("x-api-key") apiKey: String, @Body body: MultipartBody, ): UploadCatResponse I have model for request model And I have a little bit piece of code for call this interface class SendPhotoModel ..

Read more

I’ve tried to use Retrofit and faced a problem. The error says that "your JSON is bad because it even hasn’t { " but the most important thing is that API is working normally. Server responses can be two types: { status: "error", id: "", key: "", error: "wrong token" } And: { status: "ok", ..

Read more

Hello I have problem to use retrovite with get My url is like this : /infosRma?numRma=7978 I put in my Api Interface : @GET("/infosRma/{id}/numRma") Call<Rma> getRma(@Path("id") int id); and this id numer in the activity Call<Rma> rmaCall = apiInterface.getRma(79778); rmaCall.enqueue(new Callback<Rma>() { @Override public void onResponse(Call<Rma> call, Response<Rma> response) { Log.e(TAG, "onResponse*************: " + response.body() ..

Read more

I have this Interceptor, the idea is to call another API in interceptor the problem is onResponse is called with the first call val serivceCa = serivce.getDate("http://api.aladhan.com/v1/gToH?date=07-12-2014") but I want the result from the interceptor call val serivceCa = serivce.getDate("http://api.aladhan.com/v1/gToH?date=07-12-2020") addInterceptor (object : Interceptor { override fun intercept(chain: Interceptor.Chain): okhttp3.Response { val request= chain.request() val ..

Read more