tomkuijsten / restup

Webserver for universal windows platform (UWP) apps
MIT License
114 stars 48 forks source link

Would this work as a replacement for HTTPListener? #126

Closed ta-vroom closed 7 years ago

ta-vroom commented 7 years ago

I had a server which listened for JSON, but I had to start over when I moved to UWP. Any chance this could fill that role?

tomkuijsten commented 7 years ago

Depends a bit on what you want to achieve.

ta-vroom commented 7 years ago

Literally just receive JSON data from a webapp/program. Just a bit confused on REST vs Sockets and which would be most appropriate.

tomkuijsten commented 7 years ago

That's really easy to achive, take a look at the sample code or the wiki on how to achieve this.

ta-vroom commented 7 years ago

alright, thanks for the help.

ta-vroom commented 7 years ago

Is it possible to somehow get the data, without dealing with the uri? If restup won't work, I can write my own socket server. Just having trouble isolating the data from the header.

Jark commented 7 years ago

Hi,

Restup is meant as a REST server, however if you want to just use the socket to http request functionality you could implement a custom IRouteHandler (https://github.com/tomkuijsten/restup/blob/master/src/WebServer/Models/Contracts/IRouteHandler.cs) and use that in httpServer.RegisterRouteHandler.

Cheers,

Jark

ta-vroom commented 7 years ago

Thanks for the help.