{ Cliente_ID: 1, Nombre_Usuario: "dsadsadsa"}
The problem is that the api receives plain text, try to use retrofit in the following way:
Interface
@POST("Cliente")
Call<Client> newClient(@Body Client client);
Model
@SerializedName("Cliente_ID")
@Expose
private Integer clienteID;
@SerializedName("Nombre_Usuario")
@Expose
private String nombreUsuario;
contruct.. gets.sets..
Retrofit configuration
retrofit = new Retrofit.Builder()
.baseUrl(baseurl)
.addConverterFactory(ScalarsConverterFactory.create())
.addConverterFactory(GsonConverterFactory.create())
.build();
Using postman I realized that when trying to send the values at the beginning of this question as JSON (application/json)
do not accept them, just accept Text (text/plain)
are enough parameters that I should send, any solution to this? how do I configure retrofit to send the parameters in plain text, but in JSON format? ...