POST requisition on retrofit2

1

How do I send data from a form on android using retrofit2? The way I'm doing the information stored in the database are being sent through a pass by parameter, I would like to retrieve the data from an EditText for example, can anyone help me?

Here 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());
>             }
>     });
    
asked by anonymous 17.04.2016 / 09:13

0 answers