-
Notifications
You must be signed in to change notification settings - Fork 11
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: add method to initialize SDK with an httpClient #89
Conversation
jpill
commented
Jun 10, 2024
•
edited
Loading
edited
- Adds the ability to initialize SDK with an HttpClient, and to make modifications to subsequent requests
- Adds cancellation token to client
- Adds HttpResponseMessage to ShipEngineException
- Adds missing markdown
- Redefines several properties as nullable reference types
- Adds and implements IShipEngine interface with virtual mockable ShipEngine
55403e4
to
ac8aa05
Compare
ed17c45
to
9c6b2a7
Compare
0325572
to
4ec67cd
Compare
4ec67cd
to
9d3ad15
Compare
9d3ad15
to
6a2afce
Compare
6a2afce
to
e4739f7
Compare
Pull Request Test Coverage Report for Build 9652824702Details
💛 - Coveralls |
0f79f4b
to
6c7b334
Compare
Pull Request Test Coverage Report for Build 9664624594Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9664647461Details
💛 - Coveralls |
Converters = { new JsonStringEnumMemberConverter() } | ||
}; | ||
} | ||
protected Action<HttpRequestMessage>? ModifyRequest { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be protected? We want users to be able to set it. I know we talked about a .WithModifiedRequest()
method that would return a new instance with this field set, but is there any reason to force them to use that method? Seems like it should be fine to let people do client.ModifyRequest = r => ...
as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair question - I think likely not, but am just going to remove the modify request bit from this effort while that gets further consideration, so as not to cause more delay with the rest of the functionality I'm looking to deliver here
{ | ||
client.DefaultRequestHeaders.Accept.Clear(); | ||
|
||
var osPlatform = Environment.OSVersion.Platform.ToString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The duplication of all of this logic seems wrong. Can the non-static version invoke the static version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good callout, I have modified this in the updated PR here: #93
closing this PR in favor of #93 |