/// <summary> /// Plan to navigate to an action using the specified method with the given /// entity body of the mime type. /// http://www.w3.org/html/wg/drafts/html/master/forms.html#plan-to-navigate /// </summary> /// <param name="context">The browsing context.</param> /// <param name="request">The request to issue.</param> /// <param name="cancel"></param> /// <returns>A task that will eventually result in a new document.</returns> internal static Task <IDocument> NavigateToAsync(this IBrowsingContext context, DocumentRequest request, CancellationToken cancel = default) { var handler = context.GetNavigationHandler(request.Target); return(handler?.NavigateAsync(request, cancel) ?? Task.FromResult <IDocument>(null)); }