Skip to content

Instantly share code, notes, and snippets.

@Felipe00
Created September 17, 2016 13:59
Show Gist options
  • Save Felipe00/d2740a46c0115f507069b12effb53eca to your computer and use it in GitHub Desktop.
Save Felipe00/d2740a46c0115f507069b12effb53eca to your computer and use it in GitHub Desktop.
Exemplo de uso do método PUT com a biblioteca do loopJ.
public void callLoopjPut() {
AsyncHttpClient client = new AsyncHttpClient();
RequestParams params = new RequestParams();
params.add("id", "10");
params.add("name", "Felipe");
params.add("email", "[email protected]");
client.put(Teste.this, "http://www.minha-api.com.br/editarCadastro", params, new AsyncHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
// Faz algo
}
@Override
public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
// Faz algo
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment