Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support HttpClient configuration #259

Merged
merged 25 commits into from
Jul 10, 2024

Conversation

greathouse
Copy link
Contributor

@greathouse greathouse commented Jul 9, 2024

Description

Draft PR for the Developer Documentation: Basis-Theory/developers.basistheory.com#409

Testing required outside of automated testing?

  • Not Applicable

Screenshots (if appropriate):

  • Not Applicable

Rollback / Rollforward Procedure

  • Roll Forward
  • Roll Back

Reviewer Checklist

  • Description of Change
  • Description of outside testing if applicable.
  • Description of Roll Forward / Backward Procedure
  • Documentation updated for Change

@@ -172,6 +173,7 @@ namespace {{packageName}}.Client
{{>visibility}} partial class ApiClient : ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}}
{
private readonly string _baseUrl;
private HttpClient _httpClient;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allowing the client to customize the HttpClient that RestSharp uses internally.

MaxTimeout = configuration.Timeout,
Proxy = configuration.Proxy,
UserAgent = configuration.UserAgent
UserAgent = configuration.UserAgent,
ThrowOnAnyError = true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throws all errors encountered during the http process.

this.HeaderParameters.Add("BT-IDEMPOTENCY-KEY", value);
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convenience properties to set Basis Theory specific request headers.

if(requestOptions == default(BasisTheory.net.Client.RequestOptions))
{
requestOptions = new BasisTheory.net.Client.RequestOptions();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allowing the client to pass a RequestOptions object. The previous template created the RequestOptions internally.

@greathouse greathouse marked this pull request as ready for review July 9, 2024 18:21
@greathouse greathouse requested a review from a team as a code owner July 9, 2024 18:21
@greathouse greathouse merged commit 8b5afc9 into master Jul 10, 2024
1 check passed
@greathouse greathouse deleted the eng-6888-support-httpclient-configuration branch July 10, 2024 14:37
bt-platform-eng pushed a commit that referenced this pull request Jul 10, 2024
# [3.1.0](v3.0.0...v3.1.0) (2024-07-10)

### Features

* support HttpClient configuration ([#259](#259)) ([8b5afc9](8b5afc9))
@bt-platform-eng
Copy link

🎉 This PR is included in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants