title: API call using Auth to get image using HttpClient not working
body: <p>I'm attempting to retrieve an image with an API call using <code>HttpClient</code> in ASP.Net Core. The problem is, it works with regular images (ones that include the file extension type), but not with my URL.</p>
  
  <p>I don't understand if this has something to do with the API URL involving credentials or not.</p>
  
  <p>Here's a call that works:</p>
  
  <pre><code>HttpResponseMessage response = await client.GetAsync(
          "https://i.stack.imgur.com/hM8Ah.jpg?s=48&amp;g=1");
  byte[] content = await response.Content.ReadAsByteArrayAsync();
  return "data:image/png;base64," + Convert.ToBase64String(content);
  </code></pre>
  
  <p>And here's mine that doesn't:</p>
  
  <pre><code>HttpResponseMessage response = await client.GetAsync(
          "http://user:pass@CAMERA-IP/cgi-bin/snapshot.cgi?channel=0&amp;authbasic=aXU8Hu1");
  byte[] content = await response.Content.ReadAsByteArrayAsync();
  return "data:image/png;base64," + Convert.ToBase64String(content);
  </code></pre>
  
  <p>Has anyone ever encountered this problem?</p>
  
  <p>Anyone know why this isn't working?</p>
  
  <hr>
  
  <p>Here's more info about that API: <a href="http://www.techprosecurity.com/" rel="nofollow noreferrer">http://www.techprosecurity.com/</a></p>
  
  <p>It's a camera system that's hooked up to a location's IP Address that requires a user/pass to access each camera (channel).</p>