Skip to content

Commit 7411a6c

Browse files
committed
Extended the documentation
1 parent 2505068 commit 7411a6c

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 0.13.0
22

3-
Released on Monday, August 26 2019.
3+
Released on Friday, September 6 2019.
44

55
- Added additional configuration extensions
66

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,37 @@ var config = Configuration.Default
2626

2727
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`.
2828

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+
var handler = new HttpClientHandler
33+
{
34+
Proxy = new WebProxy(myProxyHost, false),
35+
PreAuthenticate = true,
36+
UseDefaultCredentials = false,
37+
};
38+
39+
var config = 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+
var config = Configuration.Default
48+
.With(new HttpClientRequester()) // 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+
var config = Configuration.Default
56+
.With(new HttpClientRequester(myHttpClient)) // re-using the HttpClient instance
57+
.WithDefaultLoader();
58+
```
59+
2960
### Cookies
3061

3162
To get improved cookie support, e.g., do

0 commit comments

Comments
 (0)