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
Set UserAgent as a default header parameter (#2157)
* Set UserAgent as a default header parameter instead of modifying the HttpClient instance.
* Update usage document
---------
Co-authored-by: Peter Breen <[email protected]>
Copy file name to clipboardexpand all lines: docs/usage.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -594,7 +594,7 @@ One way of doing it is to use `RestClient` constructors that accept an instance
594
594
595
595
-`BaseAddress` will be used to set the base address of the `HttpClient` instance if base address is not set there already.
596
596
-`MaxTimeout`
597
-
-`UserAgent` will be set if the `User-Agent`header is not set on the `HttpClient` instance already.
597
+
-`UserAgent` will be added to the `RestClient.DefaultParameters` list as a HTTP header. This will be added to each request made by the `RestClient`, and the `HttpClient` instance will not be modified. This is to allow the `HttpClient` instance to be reused for scenarios where different `User-Agent` headers are required.
598
598
-`Expect100Continue`
599
599
600
600
Another option is to use a simple HTTP client factory as described [above](#simple-factory).
0 commit comments