Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everyone!

I have just started with my first api project. It runs successfully and shows me my data in xml format on the browser.The url on the browser says localhost:<portno>/api/employees

My question is: how can i access the same data by directly typing on the above url (localhost:<portno>/api/employees) from a browser on another machine?

What I have tried:

I have just started with my first api project. It runs successfully and shows me my data in xml format on the browser.The url on the browser says localhost:<portno>/api/employees

My question is: how can i access the same data by directly typing on the above url (localhost:<portno>/api/employees) from a browser on another machine?
Posted
Updated 18-Jan-17 9:38am
v2

1 solution

Assuming you don't have a firewall between the two computers, just replace "localhost" with the name or IP address of your computer.

So instead of: http://localhost:port/api/employees
Use: http://your-pc-name:port/api/employees

If you have a firewall between the computers, you'll either need to open the port, or host your API in IIS on port 80 instead of using Visual Studio's built-in web server.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900