putAsync<TReceive> method

Future<TerraRestfulResponse> putAsync<TReceive>(
  1. String endpoint,
  2. String data
)

Runs a PUT operation via HttpClient to send and update information.

Implementation

Future<TerraRestfulResponse> putAsync<TReceive>(
    String endpoint, String data) async {
  var response = await clientService.putAsync(endpoint, data);
  if (response.statusCode != 200) {
    throw Exception(
        "Status Code: ${response.statusCode}, Reason: ${response.reasonPhrase}");
  }

  return await deserializeResponse(response);
}