deleteBookmark function
Implementation
Future<void> deleteBookmark(int bookmarkId, GuestSession session,
{String? authToken}) async {
if (!session.isAuthed) {
throw AuthError('Invalid session');
}
final data = {
'authenticity_token': authToken ?? session.authenticityToken,
'_method': 'delete',
};
final url = 'https://archiveofourown.org/bookmarks/$bookmarkId';
final response =
await session.delete(url, data: data, followRedirects: false, headers: {
'Accept': '*/*',
'Content-Type': 'application/x-www-form-urlencoded',
});
handleBookmarkErrors(response);
}