C # Error reading XML from url

I have an XML reader, but I get an error when I try to read XML from a URL (external source).

This is the code I have:

XmlReader xmlReader = XmlReader.Create("http://dl.bukkit.org/api/1.0/downloads/projects/craftbukkit/view/build-1330/");
        while (xmlReader.Read())
        {

        }

Very simple code, but it returns an error that states:

Data at the root level is invalid. Line 1, position 1.

Any idea? I cannot edit XML because it is not mine.

Thanks in advance!

+3
source share
1 answer

If you use Fiddler to analyze the response returned by the server, you will see that instead of JSON you get JSON. You can add a URL parameter to get the XML:

http://dl.bukkit.org/api/1.0/downloads/projects/craftbukkit/view/build-1330/?format=xml
+4
source

All Articles