Hello,
localhost works, IP address not, why? How can I solve it?
<appSettings>
<add key="baseAddress" value="http://127.0.0.1:8888/" />
<!--<add key="baseAddress" value="http://localhost:8888/" />-->
<add key="url" value="" />
</appSettings>
using (var request = new HttpRequestMessage(HttpMethod.Post, mesUri)) //$"{BaseAddress}{Url}"))
{
Log.Info($"[CUSTOM][PostBasis2], Adress= {requestUri}");
client.Timeout = TimeSpan.FromSeconds(3);
request.Version = HttpVersion.Version10; // Version11;
var json = JsonConvert.SerializeObject(content);
Log.Info($"[CUSTOM][PostBasis2], RequestMES=Object Post - Json\n\n{json}\n\n");
using (var stringContent = new StringContent(json, Encoding.UTF8, "application/json"))
{
request.Content = stringContent;
using (HttpResponseMessage response = client.PostAsync(requestUri, stringContent).Result)
{
I get an exception when I use the IP address. Why?
client.PostAsync(requestUri, stringContent).Result
][3]