About 1,240,000 results
Open links in new tab
  1. How to safely call an async method in C# without await

    Mar 20, 2013 · How do I safely call an async method without awaiting the result? For people suggesting that I just await the result, this is code that is responding to a web request on our web service (ASP.NET Web API).

  2. Call from Web API to another Web API without waiting for results

    May 28, 2015 · Is there a way to fire an Http call to an external web API within my own web API without having to wait for results? The scenario I have is that I really don't care whether or not the call succeeds and I don't need the results of that query.

  3. How To Call Web API without waiting response in C#

    May 16, 2018 · You just simply need to call. request.GetResponseAsync(); in place of . HttpWebResponse response = (HttpWebResponse)request.GetResponse(); This will make your call async and code will not wait for the response from the API

  4. How to use C# async/await for API calls & to stop blocking

    Jun 3, 2024 · Learn how to make an async method in C# that does an await on an ASP.NET Core Web API request and returns a Task type.

  5. web api - Should web API controller actions that perform no …

    Jan 16, 2023 · I have been going over our app web api and making sure all async work is async all the way - and no artificial asynchronicity is enforced. Say I have the following web api controller: [HttpGet] public async Task<IActionResult> Foo() { //no async work return OK(...);

  6. How to achieve non-blocking processing in a Web API method?

    Mar 30, 2023 · Here's an example of how to implement non-blocking processing in a Web API method: Declare the Web API method with the async keyword to indicate that it is an asynchronous method. Use the await keyword to call any long-running operations, such as database queries or external API requests.

  7. Using WebApiClient To Call REST APIs In .NET Core - C# Corner

    In this article, we will discuss how to use a easy way to call our REST APIs in .NET Core. When we call others' APIs in .NET Core, HttpClient will be the first choice. And most of us will create a wrapper to make it easy to use.

  8. How to Call Web API in ASP.NET Core [.NET 7.0] - YogiHosting

    Oct 21, 2023 · In this tutorial you will learn how to consume a Web API in ASP.NET Core. In order to consume the API I will use Dot Net HttpClient class in my application.

  9. .NET 6.0 and Simple (minimal) Api’s: Create an Api without

    Mar 1, 2022 · The first endpoint is how to call a method without async. This is generally not recommended, async is the preferred method . The second endpoint is how to call an async method.

  10. Should WebAPI controller actions that perform no asynchronous ... - Reddit

    your function can return a Task without being async. For example if you had a service with a synchronous GetCount() method you could expose it from you controller like this: public Task<int> GetCount() => Task.FromResult(myService.GetCount()); asp.net can await the call to the action method since it returns a Task.

  11. Some results have been removed
Refresh