/ Published in: Java
This is a class i put together to handle POST requests
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import java.io.*; import java.net.*; import javax.swing.*; public class Requests { static StringBuilder sb; domain = d; } try { sb = new StringBuilder(); myurlc = myurl.openConnection(); myurlc.setDoOutput(true); osr.write(data); osr.flush(); while((line = br.readLine()) != null) { sb.append(line); } br.close(); osr.close(); } { } finally { return sb.toString(); } } }