skip to Main Content

How do I add an API key to a HttpClient in a ASP.NET MVC application?

Assume a HttpClient having been set up to look like the following (as per standard called with a factory): builder.Services.AddControllersWithViews(); builder.Services.AddHttpClient("weather", weather => { weather.BaseAddress = new Uri("http://api.openweathermap.org/data/2.5"); weather.Timeout = TimeSpan.FromSeconds(15); }).SetHandlerLifetime(TimeSpan.FromSeconds(15)); Now when using the HttpClient to call an…

VIEW QUESTION

Asp.net – The value '' is not valid for

I have a Blazor web application which uses System.ComponentModel.DataAnnotations attribute for validation in a registration form. I have a property named NationalCode which is nullable long I did not added [Required] attribute above my NationalCode property But when I want…

VIEW QUESTION

Html – Error 500 when I called webservice with AJAX

I have web service solution in Visual Studio with one parameter : Public Function CheckPalletInLocation(location As String) As String Dim ScaleConnnection As New SqlClient.SqlConnection("MYCONNEXION") Dim ScaleCommand As New SqlClient.SqlCommand ScaleCommand.Connection = ScaleConnnection ScaleConnnection.Open() ScaleCommand.CommandText = "SELECT DISTINCT LOGISTICS_UNIT FROM LOCATION_INVENTORY…

VIEW QUESTION
Back To Top
Search