put method
PUT:
Sends a PUT request to the specified endpoint with the provided body.
Returns the response data on success, or handles errors using _handleError.
endpoint: The API endpoint to send the PUT request to.
body: The data to include in the PUT request body.
Implementation
Future<dynamic> put(String endpoint, dynamic body) async {
try {
final response = await _dio.put(endpoint, data: jsonEncode(body));
return response.data;
} catch (e) {
return _handleError(e);
}
}