putThing method
Puts a directory thing entry to the S3I-Directory.
Throws a NetworkAuthenticationException if
AuthenticationManager.getAccessToken fails. Throws a SocketException
if no internet connection is available. Throws a
NetworkResponseException if the received status code is not 204 or 201.
Implementation
Future<void> putThing(Thing thing) async {
final Response response =
await putDirectory('/things/${thing.id}', jsonBody: thing.toJson());
if (response.statusCode != 204 && response.statusCode != 201) {
throw NetworkResponseException(response);
}
}