I'm making post request, but my debugger doesn't stop after this line:
var result = await client.PostAsync(_url, data);
My full program
class Program
{
static void Main(string[] args)
{
var _url = "https://test.test.test:9100/path/path";
CheckHttpPostAsync(new { id = 123123, username = "testas" });
async Task CheckHttpPostAsync(object payload)
{
using var client = new HttpClient();
var json = JsonConvert.SerializeObject(payload);
var data = new StringContent(json, Encoding.UTF8, "application/json");
try
{
var result = await client.PostAsync(_url, data);
Console.WriteLine(result);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
and nothing gets written in console, even though im using await
The post request works fine in postman with the same JSON.
edit: added full code