Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 /// <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);
Ejemplo n.º 3
0
 /// <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));
 }