HttpRequestException: No connection could be made because the target machine actively refused it. (127.0.0.1:13847)

Viewed 51

the bellow code gives me the error when I used the same code in another asp.net core project it works and does not give me the error but in my current application it gives the error above, I used HTTPS Connection and now I changed it to HTTP but still have the same error and also when I used Postman it work for me

 HttpClient client = new HttpClient();
 client.Timeout = TimeSpan.FromMinutes(30);
 client.BaseAddress = new Uri("http://192.168.10.25/");
HttpResponseMessage getTokenresponse = client.GetAsync("api/getToken/getitss?username=Ahmad&password=ahmad@123").Result;
 var a = getTokenresponse.Content.ReadAsStringAsync();
 string token = a.Result.Replace(@"""", "").Replace(@"\", "");

and here is my

0 Answers
Related