create method

Future<Map<String, dynamic>> create(
  1. String endpoint,
  2. Map<String, dynamic> json, [
  3. bool isFormData = false
])

Creates a new register on a specific endpoint.

Sends a POST request to create a new register on the specified endpoint.

Parameters:

  • endpoint: The API endpoint to send the request to.
  • json: The data to save.
  • isFormData: Optional. Whether to send the data as form data or JSON. Defaults to false.

Returns:

A Future that completes with the created object of type T.

Implementation

Future<Map<String, dynamic>> create(String endpoint, Map<String, dynamic> json, [bool isFormData = false]) async {
  return _sendRequest('POST', endpoint, json, isFormData);
}