Skip to content

Add HTTPClientReuqest.Prepared #511

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

Merged
merged 3 commits into from
Dec 3, 2021
Merged

Conversation

dnadoba
Copy link
Collaborator

@dnadoba dnadoba commented Dec 2, 2021

Before we can execute a HTTPClientRequest we need do a couple of validation and transformation steps which can fail.
The result of the preparation is now encapsulated in a separate object called HTTPClientRequest.Prepared.

@dnadoba dnadoba added the 🔨 semver/patch No public API change. label Dec 2, 2021
@dnadoba dnadoba requested a review from fabianfett December 2, 2021 19:28
Copy link
Member

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

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

LGTM. However we should add tests with a follow up PR.

Copy link
Collaborator

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

One note about API changes, otherwise this looks good.


@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
extension HTTPClientRequest {
func prepared() throws -> Prepared {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I'd rather write this as an init on Prepared, if that's ok.

@dnadoba dnadoba merged commit 5ce7377 into swift-server:main Dec 3, 2021
@dnadoba dnadoba deleted the dn-prepared branch December 3, 2021 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants