Created
May 7, 2011 16:06
-
-
Save l1x/960605 to your computer and use it in GitHub Desktop.
post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
//data=json... | |
URL url = new URL("http://couch.nohup.hu/nohup_urls"); | |
URLConnection conn = url.openConnection(); | |
conn.setDoOutput(true); | |
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream()); | |
wr.write(data); | |
wr.flush(); | |
// Get the response | |
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); | |
String line; | |
while ((line = rd.readLine()) != null) { | |
// Process line... | |
} | |
wr.close(); | |
rd.close(); | |
} catch (Exception e) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment