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

Responding to change requests

We follow up by adding the POST method. We implement this as an asynchronous method. The library supports both synchronous responses and asynchronous responses. The main difference is that you must trap any exceptions in asynchronous methods, unless you want the application to terminate unexpectedly if one is thrown.

The first thing we do is try to decode the payload in the request. The library does this for you if the request comes with a content format specified. If one is missing, we decode the payload as if it were plain text. We also use the CommonTypes.TryParse method, which is forgiving. It recognizes 1, true, yes, and on as true values, and 0, false, no, and off as false values, using case-insensitive ...

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