See if it’s about that (if the token has to go inside the post):
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://api.dominio.com:8025/name/login");
try {
List nameValuePairs = new ArrayList();
// Aqui setamos o token:
nameValuePairs.add(new BasicNameValuePair("token", "ab124b3a1c2f"));
// repita a linha de cima quantas vezes necessário,
// com outras variaveis e parâmetros desejados.
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
} catch (ClientProtocolException e) {
// trate dos erros aqui
} catch (IOException e) {
// e aqui
}
Note that I didn’t post the code using async, I put the answer only as an initial reference. Depending on the case, the async ends up disrupting the flow when it comes to interdependent requests, as you have to manage events in your code.
Edit: you may need to use it this way by putting the whole URL here:
HttpPost httppost = new HttpPost( response );
and remove the POST token, leaving only the other necessary variables, if any:
nameValuePairs.add(new BasicNameValuePair("variavel1", "valor1..."));
nameValuePairs.add(new BasicNameValuePair("variavel2", "valor2..."));
This URL there has a parameter with GET format, is that right? The token would not have to go next to the body of the post?
– Bacco