ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. It is an ideal platform for building RESTful applications on the .NET Framework.
This is a quick overview of WebAPI 2.0 and I would be not be going into much details.
If you’ve ever had to make a web request to an HTTPS endpoint from C# you will likely run into this gem of an exception.
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Who the what now?
You may use the following method to retrieve the image from a specific URL on the web. The below C# function takes an image url, download the image from the url as a stream.
I had to retrieve and save an image from the external websites to my local folder. While it can look like a simple task at the first glance, it can be complicated when you try to find the filename & extension using the URL.
though this is an Image, you would not be able to find the filename or extension by using the URL, so I had to come up with this.