post static method
Queues a POST request.
body can be a String, Map, or any object supported by jsonEncode.
Set isMultipart to true and provide filePaths for file uploads.
Implementation
static Future<void> post(
String url, {
dynamic body,
Map<String, String>? headers,
Map<String, String>? queryParameters,
OfflinePriority priority = OfflinePriority.normal,
bool isMultipart = false,
List<String>? filePaths,
}) async {
_checkInit();
String? bodyStr;
if (body != null) {
bodyStr = body is String ? body : jsonEncode(body);
}
await _instance._manager.add(
OfflineRequest.create(
url: url,
method: 'POST',
body: bodyStr,
headers: headers,
queryParameters: queryParameters,
priority: priority,
isMultipart: isMultipart,
filePaths: filePaths,
),
);
}