// 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;
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") ?