Hi all, I'm trying to post an xml document from java to a rails application. I have a hard time writing the http request Here's my java code:
Socket sock = new Socket(addr, port);
String path = "http://127.0.0.1:3000/mycontrollers.xml";
BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(sock.getOutputStream(), "UTF-8"));
wr.write("POST +path+ " HTTP/1.0\r\n");
wr.write("Host: http://127.0.0.1:3000\r\n");
wr.write("Content-Length: " + xmldata.length() + "\r\n");
wr.write("Content-Type: text/xml; charset=\"utf-8\"\r\n");
wr.write("\r\n");
//Send data
wr.write(xmldata);
wr.flush();
In return I have : Not Found: /mycontrollers.xml
Any ideas?
Thanks a lot