Hello,
response = client.GetAsync(urlParameters).Result; // That is the reason, but why? AAA inside log BBB not!
I now have detailed information.
Can you all please help again. What can be the cause? Thanks in advance.
HttpResponseMessage response;
string urlParameters = "";
try
{
using (HttpClient client = new HttpClient())
{
client.BaseAddress = new Uri(CfgScadaSystem.Baseaddress);
client.Timeout = new TimeSpan(0, 0, CfgScadaSystem.Timeout);
string authorization = $"{CfgScadaSystem.Username}:{CfgScadaSystem.Password}";
Log.WriteLog($"[C][RO], authorization='{authorization}'");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes(authorization)));
urlParameters = CfgScadaSystem.UrlGetOrderData.Replace("{orderId}", orderId);
Log.WriteLog($"[C][RO], RequestMES=\n'{CfgScadaSystem.Baseaddress}{urlParameters}'");
Log.WriteLog($"[C][RO], Client BaseAddress= '{client.BaseAddress}' ");
Log.WriteLog("AAA");
response = client.GetAsync(urlParameters).Result; //
Log.WriteLog("BBB");
}