i have an azure function and i wanto to do a post with HttpClient to an endpoint of a certain API. I run the project without error but when the function start it throw this error. What i have to do to solve it? I searched and found a lot but nothing usefull or cleary explained.
Function :
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Net.Http;
using Tesi.Worker;
[assembly: WebJobsStartup(typeof(Startup))]
namespace Tesi.Worker
{
public class StandingsFunctions
{
private static HttpClient _client = new HttpClient();
public StandingsFunctions()
{
}
[FunctionName("WeeklyUpdateStandings")]
public void Run([TimerTrigger("0 */1 * * * *")] TimerInfo myTimer, ILogger log)
{
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
HttpContent content = null;
var response = _client.PostAsync("https://sportdataapi.azurewebsites.net/api/WebHook/UpdateStandings",content);
if (response.IsCompletedSuccessfully) { log.LogInformation("Post andata a buon fine " + response.Status.ToString()); }
else { log.LogInformation("Errore!"); }
}
}
}
framework contains System.http.net, where it's located in directory? How can i try to decrease the version to test if that is the problem?Can i delete the full framework and install all package by my self? (have sense?)