You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,37 @@ var config = Configuration.Default
26
26
27
27
This will register all requesters. Alternatively, the requesters can be provided explicitly. They are located in the `AngleSharp.Io.Network` namespace and have names such as `DataRequester`.
28
28
29
+
Requesters can make use of `HttpClientHandler` instances. Hence using it, e.g., with a proxy is as simple as the following snippet:
30
+
31
+
```cs
32
+
varhandler=newHttpClientHandler
33
+
{
34
+
Proxy=newWebProxy(myProxyHost, false),
35
+
PreAuthenticate=true,
36
+
UseDefaultCredentials=false,
37
+
};
38
+
39
+
varconfig=Configuration.Default
40
+
.WithRequesters(handler) // from AngleSharp.Io with a handler config
41
+
.WithDefaultLoader();
42
+
```
43
+
44
+
Alternatively, if you don't want to add all possible requesters, you can also just add a single requester from AngleSharp.Io:
45
+
46
+
```cs
47
+
varconfig=Configuration.Default
48
+
.With(newHttpClientRequester()) // only requester
49
+
.WithDefaultLoader();
50
+
```
51
+
52
+
In the code above we now only have a single requester - the `HttpClientRequester` coming from AngleSharp.Io. If we have an `HttpClient` already used somewhere we can actually re-use it:
53
+
54
+
```cs
55
+
varconfig=Configuration.Default
56
+
.With(newHttpClientRequester(myHttpClient)) // re-using the HttpClient instance
0 commit comments