sensaura-public / iotweb

A simple HTTP and WebSocket server component for Windows 10 IoT Core and .NET 4.5
38 stars 21 forks source link

POST method is not working #6

Open ummarbhutta opened 7 years ago

ummarbhutta commented 7 years ago

I am using this library in my Windows IoT project, bug I have found is,

  1. when I POST some form data the HttpHandler is never called
  2. it works fine for GET
  3. my form contains only 3 fields. and I am using chrome.

I am using code checked out from git-hub. not the NuGet package.

lprichar commented 7 years ago

@ummarbhutta Keep in mind I don't speak for the authors of this project, but I kind of feel like this isn't the right project to be using POST. If you want a more traditional REST API then you might want to consider a different project like: https://github.com/tomkuijsten/restup.

If, on the other hand you're ok with talking to your back-end 100% using Web Sockets, I think you'll find that it's considerably faster than with a traditional REST API on a lightweight device like a Raspberry Pi. I'm writing an Angular 2 app right now served up from iotweb on a Pi 3 using 100% web sockets, and I've been absolutely shocked at how fast my app responds compared to a prior version where I was doing all REST. All network latency just disappeared.

Anyway, long story short this may be a bug, but it's also very possible it wasn't implemented by design because it isn't necessary.

ummarbhutta commented 7 years ago

@lprichar Thanks for the response. I have used restup also, but I needed web sockets support which I didn't get in restup. and I think it is a bug in this API, and I have managed to fix it in code base. I will try to contact author to discuss these changes and if I or he can checkin these changes.

lprichar commented 7 years ago

@ummarbhutta Nice! I think the authors may have moved on to other things, but I do know they still accept pull requests since they accepted one of mine.