public async Task Remove(NbPart part) { var cookie = context.GetCookie(new Url(_bookUrl)); var url = $"{_bookUrl}{part.Volume.Id}/{part.Id}/remove"; WebRequest request = WebRequest.Create(url); request.Method = "POST"; request.Headers[HttpRequestHeader.Cookie] = cookie; await request.GetResponseAsync(); part.Removed = true; }
/// <summary> /// Gets the cookie string for the given URL. /// </summary> /// <param name="url">The requested URL.</param> /// <returns>The associated cookie string, if any.</returns> protected virtual String GetCookie(Url url) => _context.GetCookie(url);
/// <summary> /// Gets the cookie string for the given URL. /// </summary> /// <param name="url">The requested URL.</param> /// <returns>The associated cookie string, if any.</returns> protected virtual String GetCookie(Url url) { return(_context.GetCookie(url)); }