title: UWP - How can i get a file (xml) from http?
body: <p>I have this code to load the xml (to a List) and it works fine:</p>
  
  <pre><code>public MainPage()
  {
      this.InitializeComponent();
      string XMLFilePath = Path.Combine(Package.Current.InstalledLocation.Path, "something.xml");
      XDocument loadedData = XDocument.Load(XMLFilePath);
  }
  </code></pre>
  
  <p>what if I want to call the xml from my server!? </p>
  
  <p>This is the last try: </p>
  
  <pre><code>using System.Net.Http;
  using System.Runtime.Serialization.Json;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>private string jsonString;
  
      public MainPage()
      {
          this.InitializeComponent();
  
          loadData();
  
          //string XMLFilePath = Path.Combine(Package.Current.InstalledLocation.Path, "something.xml");
          XDocument loadedData = XDocument.Load(jsonString);
  </code></pre>
  
  <p>...</p>
  
  <pre><code>private async void loadData()
      {
          var httpClient = new HttpClient();
          HttpResponseMessage response = await httpClient.GetAsync(new Uri("http://domain.com/something.xml"));
          jsonString = await response.Content.ReadAsStringAsync();
      }
  </code></pre>
  
  <p>this is the error:</p>
  
  <pre><code>An exception of type 'System.ArgumentNullException' occurred in System.Xml.ReaderWriter.dll but was not handled in user code
  </code></pre>
  
  <p>Any help would be great.</p>
  
  <p>Thanks.</p>