put method

Future put(
  1. String model,
  2. String body, {
  3. String? field,
  4. String? value,
  5. Map<String, String>? customHeaders,
  6. String pageId = "1",
  7. String pageSize = "0",
  8. String contentType = "application/json",
})

PUT Request

Implementation

Future<dynamic> put(String model, String body,
    {String? field,
    String? value,
    Map<String, String>? customHeaders,
    String pageId = "1",
    String pageSize = "0",
    String contentType = "application/json"}) async {
  http.Response response;

  try {
    response = await client.put(
      generateEndpointUrl(model, field: field, value: value),
      headers: generateHeader(
          customHeaders: customHeaders,
          pageId: pageId,
          pageSize: pageSize,
          contentType: contentType),
      body: body,
    );
  } catch (e) {
    throw Exception("Unable to make PUT request. ${e.toString()}");
  }

  return response;
}