I have two asp.net core 3.1 api solution . I am trying to call port number 2005 from port number 2001 using http client
public const string _callurl = "http://localhost:2005/api/Product/Productspecific";
.i am getting exception like No connection could be made because the target machine actively refuse what will be the issue?
- public async Task
ResultcallHttpclient(Input input) - {
- var requestUri = string.Format(UrlPatterns._callurl, _Uri);
- StringContent content = new StringContent(JsonConvert.SerializeObject(input), Encoding.UTF8, "application/json");
- var httpResponse = await _singleton.Client.PostAsync(requestUri,content);
- switch (httpResponse.StatusCode)
- {
- case HttpStatusCode.OK:
- var jsonResponse = await httpResponse.Content.ReadAsStringAsync();
- return JsonConvert.DeserializeObject
(jsonResponse); - case HttpStatusCode.NotFound:
- return QualityCheckResults.CreateAsNotFound();
- default:
- }
- }
Sujeet RamanPosted Feb 8, 2021, 2:57 PM
Rijwan AnsariPosted Feb 8, 2021, 2:44 PM
Sujeet RamanPosted Feb 8, 2021, 2:31 PM
Kiran MohantyPosted Feb 8, 2021, 2:19 PM
Sujeet RamanPosted Feb 8, 2021, 1:49 PM
Kiran MohantyPosted Feb 8, 2021, 1:39 PM
Sujeet RamanPosted Feb 8, 2021, 1:34 PM
Kiran MohantyPosted Feb 8, 2021, 1:17 PM
Sujeet RamanPosted Feb 8, 2021, 1:03 PM
Kiran MohantyPosted Feb 8, 2021, 12:52 PM
Sujeet RamanPosted Feb 8, 2021, 12:34 PM
Kiran MohantyPosted Feb 8, 2021, 12:18 PM
Sujeet RamanPosted Feb 8, 2021, 12:11 PM
Kiran MohantyPosted Feb 8, 2021, 12:03 PM
Sujeet RamanPosted Feb 8, 2021, 12:00 PM
Kiran MohantyPosted Feb 8, 2021, 11:47 AM
Sachin SinghPosted Feb 8, 2021, 11:37 AM
Sujeet RamanPosted Feb 8, 2021, 9:05 AM
localhost refused to connect.
Try:
Kiran MohantyPosted Feb 8, 2021, 8:28 AM