formData method
void
formData(})
POST request with FormData content.
Perform a POST request to API with specific
path
and a formData as data.
Usefull for uploading files
You can specify the headers
for request.
Implementation
void formData(
String path, {
required FormData body,
Map<String, String>? headers,
String? contentType,
bool withLoading = true,
dynamic Function(Map<String, dynamic>)? fromJson,
void Function(int, int)? onProgressChanged,
}) =>
add(
RestEvent.formData(
path,
body: body,
contentType: contentType,
fromJson: fromJson,
headers: headers,
withLoading: withLoading,
),
);