简体   繁体   中英

How to create HTTP Web server in C# handling multiple routes?

I am trying to create a Listener (that listens multiple routes). But I don't manage to find the right solution. My problem is : I am running locally Ngrok (on my 8000 port), and an API is sending JSON (with REST request) to my ngrok address. How can I correctly listen the routes called by the API in CSharp ?

Have you considered ASP.NET Web API ? Looks like it's exactly what you need.

I have found the solution. My route was : http://localhost:8000/foo/bar To correct the problem, I have changed the route in : http://+:8000/foo/bar

Hope this will help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM