Search code examples
c#.netpostmanlocalhostip

How to make a request to a local API running on localhost using the local IP in Postman in C#


I am developing an api that has to communicate with another api. Before the deployment I want to test it and also in debug mode other api's sandbox able to send requests to my api using my ip adress. So I want to try it on postman first.

I tried to send request like https://192.168.1.100:3000/api/Controller/getAll from postman then I get error: Error: connect ECONNREFUSED 192.168.1.100:3000

I tried both Postman proxy settings closed and open and got same error. Other postman request like https://localhost:3000/api/Controller/getAll to localHost works perfectly.


Solution

  • You should change your app's listening IP.

    on launchSettings.json:

    'applicationURL' = 'https://localhost:3000'

    'applicationURL' = 'https://192.168.1.100:3000'