Co w tym kodzie jest nie tak?
async static void PostRequest(string URI)
{
IEnumerable<KeyValuePair<string, string>> queries = new List<KeyValuePair<string, string>>()
{
new KeyValuePair<string,string>("type","onip"),
new KeyValuePair<string, string>("identifier","8223209190")
};
HttpContent q = new FormUrlEncodedContent(queries);
using (HttpClient Client = new HttpClient())
{
//Client.BaseAddress = new Uri("https://ksef-test.mf.gov.pl/");
using (HttpResponseMessage response = await Client.PostAsync("https://ksef-test.mf.gov.pl/api/online/Session/AuthorisationChallenge/", q))
{
using (HttpContent content = response.Content)
{
string myContent = await content.ReadAsStringAsync();
HttpContentHeaders headers = content.Headers;
Console.WriteLine(myContent);
}
}
}
}