How to use multple @Path parameter in GET for modification

I want to pass the runtime of several parameters in the post-cleanup method for my Android project. Below is my url

http://myservice.com/home/MobileAPI/MobAPI.svc/LoginCriteria/26/address/1/permenant

Here I use the base URL as: http://myservice.com/home/MobileAPI/MobAPI.svc

I want to pass 'address' and 'permenant' at runtime in my GET method using Retrofit.

I am trying to do it like:

@GET("LoginCriteria/26/{address}/1/{permenant}") void getDetails(@Path("address") String address,@Path("permenant") String permenant, Callback<AddressParser> parserCallback); 

Here is my JSON answer:

 { "response": { "type": "success", "data": { "datalist": { "total": "20", "user": [ { "empcode": "", "companycode": "", "companyname": "" }, { "empcode": "", "companycode": "", "companyname": "" } ] } } } } 

I get the following execution:

Internal error com.fasterxml.jackson.databind.JsonMappingException: Unable to deserialize java.util.ArrayList instance from START_OBJECT.

If I execute only one parameter at runtime, it works. It does not work for several @Path parameters. Any suggestion would be greatly appreciated.

+5
source share
1 answer

I think the problem is not related to your path parameters. I am sure that this is somehow related to the response to your request.

Enable retrofit logging and check the URL and the specified response.

An exception indicates that Jackson could not parse the response to your request.

0
source

Source: https://habr.com/ru/post/1234088/


All Articles