try { URL url = new URL("http://requestb.in/14a9s7m1"); HttpURLConnection conn; conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setDoOutput(true); OutputStream os = null; try { os = conn.getOutputStream(); os.write("fkdlsakl!".getBytes()); } catch (Exception e) { e.printStackTrace(); } os.close(); conn.connect(); int respCode = conn.getResponseCode(); if(respCode == 200) { InputStream ip = conn.getInputStream(); // response.headers = conn.getHeaderFields(); int s = ip.read(); ip.close(); } } catch (Exception e) {}
jueves, 30 de enero de 2014
Post data in body part
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario