S
S
super152020-02-18 22:48:09
ASP.NET
super15, 2020-02-18 22:48:09

How to constantly make ASP.NET CORE requests?

It is necessary in ASP.NET CORE to make requests to a third-party API every minute and store this in the database. What is the smartest way to do this? Is it possible to add an implementation of this task to ConfigureServices? Or will it not work?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Developer, 2020-02-18
@samodum

Write a Windows Service, let it spin and make requests.
Even easier - write a script in python

S
Sergey V, 2020-02-19
@dthpth

yes, you can describe this in your BackgroundService implementation class and add it to the host configuration
and in the service itself, for example, a loop while(true) {..}, and for a delay between Task.Delay(..)
upd requests:
here are examples of services (including with a timer): https://docs.microsoft .com/ru-ru/aspnet/core/funda...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question