Skip to content

How to use the HttpClientHelper

  • A simple example that shows how to use the NuGet package BoTech.HttpClientHelper.
  • First, you obviously need to install the package:
Terminal window
dotnet add package BoTech.HttpClientHelper
  • And then you can use the package, for example, as follows:
Program.cs
using BoTech.HttpClientHelper;
using System.Text;
Console.WriteLine("Welcome to BoTech.HttpClientHelper. \n Testing some features...");
HttpRequestHelper httpRequestHelper = new HttpRequestHelper("https://example.com/");
RequestResult<string> result = httpRequestHelper.HttpGetString("").Result;
if(result.IsSuccess())
{
Console.WriteLine("Result is: " + result.ParsedData);
}