import 'dart:io'; import 'package:http/http.dart' as http; import '../nextcloud_ocs.dart'; import 'fileSharingApiParams.dart'; class FileSharingApi { Future share(FileSharingApiParams query) async { final endpoint = NextcloudOcs.uri( 'apps/files_sharing/api/v1/shares', queryParameters: query.toJson(), ); final response = await http.post(endpoint, headers: NextcloudOcs.headers()); if (response.statusCode != HttpStatus.ok) { throw Exception('Api call failed with ${response.statusCode}: ${response.body}'); } } }