IServiceCollection does not contain a defintion for AddHttpClient
Aah, I have found the solution. I think services.AddHttpClient
work with .net core 2.1. So I updated my .net core version to 2.1 and updated the microsoft packages to 2.1 and it starts working.
You need to install Microsoft.Extensions.Http
from NuGet