Wednesday, 23 August 2023

ASP.NET Hosting Tutorial: SYSLIB0014: WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete

Leave a Comment

Here is a basic replacement for WebClient using HttpClient:

public async Task<string?> ReadString()
{

    using HttpClient httpClient = new HttpClient();

    var _baseUrl = $"https://myjsonwebserver.com.br/";

    var response = await httpClient.GetAsync(_baseUrl);
    if (response.IsSuccessStatusCode)
    {
        var result = await response.Content.ReadAsStringAsync();

        return result;
    }

    return null;
}

I hope this helps you or myself in the future.

Best ASP.NET Core 8.0 Hosting Recommendation

One of the most important things when choosing a good ASP.NET Core 8.0 hosting is the feature and reliability. HostForLIFE is the leading provider of Windows hosting and affordable ASP.NET Core, their servers are optimized for PHP web applications. The performance and the uptime of the hosting service are excellent and the features of the web hosting plan are even greater than what many hosting providers ask you to pay for. 

At HostForLIFEASP.NET, customers can also experience fast ASP.NET Core hosting. The company invested a lot of money to ensure the best and fastest performance of the datacenters, servers, network and other facilities. Its datacenters are equipped with the top equipments like cooling system, fire detection, high speed Internet connection, and so on. That is why HostForLIFEASP.NET guarantees 99.9% uptime for ASP.NET Core. And the engineers do regular maintenance and monitoring works to assure its Orchard hosting are security and always up.

 

0 comments:

Post a Comment