1
How do I send data from a form on android using retrofit2? The way I am doing the information stored in the database is being sent through a passage per parameter, I would like to recover the data from an Edittext for example, someone can help me?
Below is my code using retrofit2:
> Call<Usuario> call = usuarioAPI.criaUsuario(new
> Usuario("login","senha","nome"));
> call.enqueue(new Callback<Usuario>() {
> @Override
> public void onResponse(Response<Usuario> response, Retrofit retrofit) {
>
> if (!response.isSuccess()) {
> response.body().getLogin();
> Log.i("TAG", "POST Erro: " + response.code());
> } else {
> Log.i("TAG", "POST Sucesso: " + response.code());
> }
> }
>
> @Override
> public void onFailure(Throwable t) {
> Log.i("TAG", "Erro no método onFailure: " + t.getMessage());
> }
> });