Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

My request to datafeed returns null, when calling from my own android device

$
0
0

I have made an app which makes a request to a xmlfeed. When I try to send a request through the app from my own android device returns a blank result string. But when i try from the android emulator or UWP on my laptop, it returns the xmlstring. Im using Httpclient.

I have tried to call the request in the browser on the device, and it also returns the string with the correct values. When i debug it breaks at the deserializing, because the result string is "".

 public async Task<XmlData> GetAllDataForToday(DateTime dt)
 {
    HttpClient client = GetClient();
    string result = await client.GetStringAsync(Url + "getData.aspx? + "fromDate=" + dt + "&toDate=" + dt);
    XmlSerializer Deserializer = new XmlSerializer(typeof(XmlData), new XmlRootAttribute("XmlData"));
    var reader = new StringReader(result);
    XmlData DataCollection = (XmlData)Deserializer.Deserialize(reader);
    return DataCollection;
}

What could be the issue?


Viewing all articles
Browse latest Browse all 204402


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>