Introduce new Request class to represent requests to Stripe's API #1508
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
r? @remi-stripe @brandur-stripe
This one is fairly straightforward. It adds a new
Stripe.Infrastructure.Request
class whose job is to turn the request parameters provided by services:HttpMethod
: HTTP method (...)path
: relative path, e.g./v1/charges
options
:BaseOptions
instance containing the request parameters, ornull
requestOptions
:RequestOptions
instance containing the request's "modifiers" to e.g override the global API key or set an idempotency keyinto .NET's HTTP library classes:
HttpMethod
: this one is untouchedUri
:System.Net.Uri
instance containing the full URL, including the base path, and for non-POST requests, the parameters encoded in the query stringAuthorizationHeader
:System.Net.Http.Headers.AuthenticationHeaderValue
representing theAuthorization
header with our preferred "Bearer" scheme and the API keyStripeHeaders
: a dictionary containing Stripe-specific HTTP headers. All requests includeStripe-Version
, and may includeStripe-Account
and/orIdempotency-Key
Content
: for POST requests, aSystem.Net.Http.HttpContent
instance representing the request's body. For non-POST requests,null
.