2003/09/27 09:08:26
[org.ibex.core.git] / src / org / xwt / HTTP.java
index fed6e6e..8f26528 100644 (file)
@@ -323,6 +323,10 @@ public class HTTP {
     // Everything Else ////////////////////////////////////////////////////////////////////////////
 
     private synchronized void connect() throws IOException {
+        if (originalUrl.equals("stdio:")) {
+            in = new BufferedInputStream(System.in);
+            return;
+        }
         if (sock != null) {
             if (in == null) in = new BufferedInputStream(sock.getInputStream());
             return;
@@ -366,7 +370,7 @@ public class HTTP {
 
     public void sendRequest(String contentType, String content) throws IOException {
 
-        PrintWriter pw = new PrintWriter(new OutputStreamWriter(sock.getOutputStream()));
+        PrintWriter pw = new PrintWriter(new OutputStreamWriter(originalUrl.equals("stdio:") ? System.out : sock.getOutputStream()));
         if (content != null) {
             pw.print("POST " + path + " HTTP/1.1\r\n");
             int contentLength = content.substring(0, 2).equals("\r\n") ?