O'Reilly logo

Mastering Internet of Things by Peter Waher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Posting login form

After filling out the form in a browser, and pressing the Login button, the contents will be sent to the server resource /Login using the POST method. We need to add such a resource to the server:

this.httpServer.Register("/Login", null, (req, resp) => 
{ 
   // Code comes here 
}, true, false, true); 

Here we've registered only a POST handler. The first true parameter tells the server the resource is synchronous. The following false tells the server that we only serve the /Login resource, and not any sub-resources. The last true tells the server the resource requires a user session.

If sending the form over an unencrypted line, as is the case if you use UWP, the password will be readable by anybody sniffing the network traffic. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required