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

Introduce new Request class to represent requests to Stripe's API #1508

Merged
merged 1 commit into from
Feb 9, 2019

Conversation

ob-stripe
Copy link
Contributor

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, or null
  • requestOptions: RequestOptions instance containing the request's "modifiers" to e.g override the global API key or set an idempotency key

into .NET's HTTP library classes:

  • HttpMethod: this one is untouched
  • Uri: System.Net.Uri instance containing the full URL, including the base path, and for non-POST requests, the parameters encoded in the query string
  • AuthorizationHeader: System.Net.Http.Headers.AuthenticationHeaderValue representing the Authorization header with our preferred "Bearer" scheme and the API key
  • StripeHeaders: a dictionary containing Stripe-specific HTTP headers. All requests include Stripe-Version, and may include Stripe-Account and/or Idempotency-Key
  • Content: for POST requests, a System.Net.Http.HttpContent instance representing the request's body. For non-POST requests, null.

@brandur-stripe
Copy link
Contributor

Nice!

LGTM.

@ob-stripe ob-stripe merged commit 9869f65 into integration-v23 Feb 9, 2019
@ob-stripe ob-stripe deleted the ob-request branch February 9, 2019 01:22
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