update method
Updates a register on a specific endpoint.
Sends a PUT request to update a 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 tofalse
.
Returns:
A Future that completes with the updated object of type T
.
Implementation
Future<Map<String, dynamic>> update(String endpoint, Map<String, dynamic> json, [bool isFormData = false]) async {
return _sendRequest('PUT', endpoint, json, isFormData);
}