views:

28

answers:

1
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
        <image_hash>cxmHM</image_hash>
        <delete_hash>NNy6VNpiAA</delete_hash>
        <original_image>http://imgur.com/cxmHM.png&lt;/original_image&gt;
        <large_thumbnail>http://imgur.com/cxmHMl.png&lt;/large_thumbnail&gt;
        <small_thumbnail>http://imgur.com/cxmHMl.png&lt;/small_thumbnail&gt;
        <imgur_page>http://imgur.com/cxmHM&lt;/imgur_page&gt;
        <delete_page>http://imgur.com/delete/NNy6VNpiAA&lt;/delete_page&gt;
</rsp>

This is the typical response I'll receive. I've tried the following but I get an error telling me that Non White Space Characters Cannot Be Added To Content.

XDocument response = new XDocument(w.UploadValues("http://imgur.com/api/upload.xml", values));    
+1  A: 
byte[] responseData = w.UploadValues("http://imgur.com/api/upload.xml", values);
string responseText = Encoding.ASCII.GetString(responseData);  //  ASCII assumed
XDocument respnseXml = XDocument.Parse(responseText); 

But that Error could as well come from the values.

Henk Holterman