Skip to content

Conversation

PetesBreenCoding
Copy link
Contributor

@PetesBreenCoding PetesBreenCoding commented Nov 3, 2023

Description

When a UserAgent is set in the RestClientOptions passed to the RestClient constructor, the UserAgent is now set as a HTTP header in the DefaultParameters property rather than modifying the HttpClient instance. This is so that the HttpClient instance can be re-used for APIs etc that require different UserAgent headers.

The ConfigureHttpClient method still sets the max timeout as that's set on the client instance itself, not a HTTP header.

I did not modify the "ExpectContinue" behaviour as it seems to have complex logic around parsing values rather than just directly setting them. If this is something you'd like to be in the DefaultParameters property too I can consider that.

Purpose

This pull request is a:

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@PetesBreenCoding
Copy link
Contributor Author

@dotnet-policy-service agree [company="{your company}"]

@dotnet-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants