post<T> method
Sends a POST request to endpoint. If body contains a File or
local file path (and autoDetectFiles isn't disabled), or files
is provided, the request is sent as multipart form data — otherwise
it's sent as raw JSON.
Pass forceRaw: true to send body exactly as given (skipping file
detection and JSON-map handling entirely) — useful for endpoints that
expect a raw string/XML/pre-encoded payload instead of a JSON map.
Implementation
Future<SmartApiResponse<T>> post<T>(String endpoint,
{dynamic body,
List<SmartApiFile>? files,
Map<String, dynamic>? queryParams,
bool? autoDetectFiles,
bool forceRaw = false,
T Function(dynamic)? fromJson,
bool showLoader = true}) =>
call<T>(
SmartApiRequest(
endpoint: endpoint,
method: ApiMethod.post,
body: body,
files: files,
queryParams: queryParams,
autoDetectFiles: autoDetectFiles,
forceRaw: forceRaw,
showLoader: showLoader,
),
fromJson: fromJson);