I am trying to make a soap request:
var _apiUrl = "https://www1.gsis.gr:443/wsaade/RgWsPublic2/RgWsPublic2";
using (var httpClient = new HttpClient())
{
var response = await httpClient.PostAsync(
_apiUrl, new StringContent(
"myXML",
Encoding.UTF8,
"application/soap+xml"));
if (response.IsSuccessStatusCode)
{
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
When trying to make the request I am getting error in response
" Exception thrown: 'System.Net.Http.HttpRequestException' in mscorlib.dll."
I have windows 7 64bit, and I am using the .net framework 4.7.2. If I will run the project in windows 10 or if I will downgrade my framework in 4.6.1 then it works fine. Why this is happening?

"text/xml; encoding='utf-8'"andxmlserialization it should like thisSystem.Text.Encoding.ASCII.GetBytes(myXML);