'I need help building an api to connect with another system by .net framework mvc

have a project in MVC using .NET Framework v4.7 . What I need to know is how to use a bulding api for integration with other system. Knowing that the other system gave me all the requirements to connect with it

I've searched everywhere looking for a solution sample, but I couldn't find anything.

If anyone could help, I would be grateful.



Solution 1:[1]

You can use HttpClient() class which is under System.Net.Http namespace.

      using (var client = new HttpClient())
      {
         HttpResponseMessage response = await client.GetAsync("http://www.contoso.com/");
        
         string responseBody = await response.Content.ReadAsStringAsync();
         // Above three lines can be replaced with new helper method below
         // string responseBody = await client.GetStringAsync(uri);
    
         Console.WriteLine(responseBody);
      }
  

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rajon Tanducar