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

Move base URLs out of resource services where possible #1490

Merged
merged 1 commit into from
Jan 28, 2019

Conversation

ob-stripe
Copy link
Contributor

r? @brandur-stripe @remi-stripe
cc @stripe/api-libraries

Simply base URL handling by centralizing it into Service base class.

Individual services can override the base URL in one of two ways:

  • by overriding the BaseUrl property for the service itself, which will set the base URL for all methods in the service (e.g. OAuthTokenService)
  • by setting the BaseUrl property in RequestOptions, which will set the base URL for the specific request (e.g. FileService.Create / CreateAsync)

return Mapper<File>.MapFromJson(
Requestor.PostFile(
this.ClassUrl(StripeConfiguration.FilesBase),
StripeConfiguration.FilesBase + this.ClassUrl(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically, setting requestOptions.BaseUrl is useless here because the method doesn't call Service.Request. That's only temporary because Service.Request doesn't support multipart encoding yet, but I'll fix that later. In the meantime, this ensure that requestOptions.BaseUrl is consistent with the URL that is passed to Requestor.PostFile.

@ob-stripe ob-stripe merged commit ed00294 into integration-v23 Jan 28, 2019
@ob-stripe ob-stripe deleted the ob-requestoptions-baseurl branch January 28, 2019 21:09
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