put method
Implementation
Future<WebResponse> put(
{required String path, required Map<String, dynamic>? jsonBody}) async {
try {
final response = await _dio.put(
path,
data: jsonBody,
);
return WebResponse(body: response.data);
} on DioException catch (e) {
if (e.response?.statusCode == 401) {
appManager.clearCurrentUser();
return WebResponse.unAuthorized(e.response?.data);
} else {
return WebResponse.systemError(e.response?.data ?? e.message);
}
} catch (e) {
throw Exception('PUT request failed: ${e.toString()}');
}
}