This is the interface method:
@FormUrlEncoded
@POST (“url/myurl")
Call<JsonArray> sendParameters (@Header("x-imei") String imei, @Header("x-id-cliente") String idCliente, @Field(“param1") JsonObject param1, @Field(“param2") JsonArray param2, @Field(“param3") JsonArray param3, @Field(“param4") JsonArray param4,@Field(“param5") JsonArray param5);
And the method to use it:
Call<JsonArray> peticion= RetrofitClient.getRetrofitClient(getActivity()).sendParameters(settings.getString("imei", ""), settings.getString("idCliente", "”),param1,param2,param3,param4,param5);
This way, the call is not working.
I tried changing all the interface parameters to String, and doing param1.toString(), param2.toString() and so on in the call, and is not working neither.
Is there a simple way to send JsonObjects and JsonArrays in a POST, using Retrofit 2?
Thank you.