Here is the code i have used as a get request to get an xml file and store it locally. The one problem i have is when its stored locally it doesn't appear in the format it should be, like an xml file structure its all over the place. Is there anyway i can sort this.
When the file has been created locally. There is header information which has been placed in the file by the server due to the get request. Can i delete this information in java. It's just when i try to parse the xml file, i can't and i think it's the header information causing the problem.
Don't use a plain socket. Use a URL like in the JavaAlmanac example I linked before. The URL class (actually a HttpURLConnection instance under the covers) takes care of all the housekeeping like headers and all you get back is the content.