Problemer med outputstream writer og &-tegnet
I need to submit some data to a HTTP-server for processing.I create the OutputStreamWriter with the following code:
HttpURLConnection http = (HttpURLConnection)url.openConnection();
... Some properties for the http object.
OutputStreamWriter writer = new OutputStreamWriter(http.getOutputStream());
writer.write("xml=" + xml) // xml is the formdata that I want to submit...
writer.flush();
writer.close();
The code works just fine, as long as the xml-variable dosen't contain the character '&'. When the writer comes to this character it stops sending data and just continues throug the rest of the code.
Is the letter '&' some kind of escape character or is there a workaround for it?