Home > Mobile >  ASP.NET Core Web API - Create Custom Requests and Responses
ASP.NET Core Web API - Create Custom Requests and Responses

Time:10-08

I'm completely new to .NET and C# programming. I'm working on a project that requires me to develop a .NET base web application.

I have been able to do most parts of the project but I'm having issues with the ASP.NET Core Web API.

I want to make HTTP Get request from the front end but I do not know how to remove the WeatherForecast sample and write my own requests and response.

Any help regarding how to create the basic template for the HTTP requests would be highly appreciated.

Thank you!

CodePudding user response:

I want to make HTTP Get request from the front endWeb api doesn't contain front end.If you want to send requests in web api,you can try to use HttpClient,here is a sample with get request:

HttpClient client = new HttpClient();
 HttpResponseMessage response = await client.GetAsync("{url}");

For more details,you can refer to the doc.

  • Related