HTTP GET request for receiving binary content of XML file

I am trying to get the binary content of an XML file via HTTP, but the server just wants to give me some kind of interpreted format (which removes \ r for each \ r \ n).

My HTTP GET request is simple: "GET http: //% s% s% s HTTP / 1.0 \ r \ nConnection: Keep-Alive \ r \ n \ r \ n"

It works for extensions other than .xml. And if I change .xml to .notxml, it works.

So, I am looking for a way for binary content without any changes to the file.

Thanks in advance.

+4
source share
3 answers

This is caused by my FTP client (FileZilla). If I transfer .nxml and rename to .xml over FTP, the file is fine. Thanks for helping me.

+1
source

The problem is on the server. When you request an XML file, it looks in a table that displays the extensions in Mime-Types. In the case of the default for the mime type for XML, there is either text/xml or application/xml , both of which are considered text formats and must be translated to the end of the line. To get a binary stream for XML, you need to find a way to get the server to treat it as binary rather than text. This means changing the server configuration or using another extension that is considered binary.

+1
source

This is almost certainly a Mime-Type problem. If you are using IIS, I would suggest checking:

http://technet.microsoft.com/en-us/library/bb742440.aspx

+1
source

All Articles