File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,26 @@ private Page(
165165 /// <summary>
166166 /// Raised when a <see cref="Response"/> is received.
167167 /// </summary>
168+ /// <example>
169+ /// An example of handling <see cref="Response"/> event:
170+ /// <code>
171+ /// <![CDATA[
172+ /// var tcs = new TaskCompletionSource<string>();
173+ /// page.Response += async(sender, e) =>
174+ /// {
175+ /// if (e.Response.Url.Contains("script.js"))
176+ /// {
177+ /// tcs.TrySetResult(await e.Response.TextAsync());
178+ /// }
179+ /// };
180+ ///
181+ /// await Task.WhenAll(
182+ /// page.GoToAsync(TestConstants.ServerUrl + "/grid.html"),
183+ /// tcs.Task);
184+ /// Console.WriteLine(await tcs.Task);
185+ /// ]]>
186+ /// </code>
187+ /// </example>
168188 public event EventHandler < ResponseCreatedEventArgs > Response ;
169189
170190 /// <summary>
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ namespace PuppeteerSharp
1212 /// <summary>
1313 /// <see cref="Response"/> class represents responses which are received by page.
1414 /// </summary>
15+ /// <seealso cref="Page.GoAsync(int, NavigationOptions)"/>
16+ /// <seealso cref="Page.GoForwardAsync(NavigationOptions)"/>
17+ /// <seealso cref="Page.ReloadAsync(int?, WaitUntilNavigation[])"/>
18+ /// <seealso cref="Page.Response"/>
19+ /// <seealso cref="Page.WaitForResponseAsync(Func{Response, bool}, WaitForOptions)"/>
1520 public class Response
1621 {
1722 private readonly CDPSession _client ;
You can’t perform that action at this time.
0 commit comments