Boa tarde,
-- estou tentando conectando ao servidor wcf, como o metodo httpUrlConnection, ele esta voltando um erro 307, ja tentei usar Volley e OKHttp e o erro é o mesmos, sei que o problema nao esta no servidor.
URL url = new URL(url);
conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.addRequestProperty("Content-Type", "Content-Type:application/json");
HttpURLConnection.setFollowRedirects(true);
conn.setFollowRedirects(true);
conn.setInstanceFollowRedirects(true);
conn.setDoOutput(true);
String str = meu login;
byte[] b = str.getBytes("UTF-8");
OutputStream out = conn.getOutputStream();
out.write(b);
out.close();
conn.connect();
int response = conn.getResponseCode();
Log.d("TESTE", "resposta " + response);
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
0 comentários:
Postar um comentário