toMap method

Map<String, Object?> toMap()

Implementation

Map<String, Object?> toMap() {
  final conf = <String, Object?>{
    'endpoint': endpoint,
    'method': method?.name,
    'customPostPath': customPostPath?[0] == '/'
        ? customPostPath?.substring(1)
        : customPostPath,
    'requestHeaders': requestHeaders
  };
  conf.removeWhere((key, value) => value == null);
  return conf;
}