post method

Future post(
  1. String api,
  2. Map<String, String?>? body, {
  3. Map<String, Uint8List?>? files,
  4. Map? params,
  5. bool discardResponse = false,
  6. bool objectify = true,
})

Implementation

Future<dynamic> post(String api, Map<String, String?>? body,
    {Map<String, Uint8List?>? files,
    Map? params,
    bool discardResponse = false,
    bool objectify = true}) async {
  if (!_initialized) {
    throw DRAWAuthenticationError(
        'Cannot make requests using unauthenticated client.');
  }
  final path = Uri.https(defaultOAuthApiEndpoint, api);
  final response = await auth.post(path, body, files: files, params: params);
  if (discardResponse) {
    return null;
  }
  return objectify ? _objector.objectify(response) : response;
}