get method

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

GET Request

Implementation

Future<dynamic> get(String model,
    {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.get(
      generateEndpointUrl(model, field: field, value: value),
      headers: generateHeader(
          customHeaders: customHeaders,
          pageId: pageId,
          pageSize: pageSize,
          contentType: contentType),
    );
  } catch (e) {
    throw Exception("Unable to make GET request. ${e.toString()}");
  }

  return response;
}