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

Unfreeze HTTPMethod #2901

Merged
merged 2 commits into from Aug 13, 2019

Conversation

@jshier
Copy link
Contributor

commented Aug 12, 2019

Goals ⚽️

This PR converts HTTPMethod from an enum into a struct. This should allow users to keep using HTTPMethod when they have to make calls using methods we don't cover, without having to resort to raw Stringss.

Implementation Details 🚧

HTTPMethod is now a struct conforming to RawRepresentable, Equatable, and Hashable. No internal changes were necessary except for the use of a no longer optional initializer. All Strings can be made valid HTTPMethods now, standardizing on the uppercased() value of the String as the rawValue.

Testing Details 🔍

No tests added, as there's no custom behavior here. Can certainly be added if there's anything that might be necessary.

@cnoon
cnoon approved these changes Aug 12, 2019
Copy link
Member

left a comment

Looks good to me @jshier, just had a single question about the uppercase requirement.

Source/HTTPMethod.swift Outdated Show resolved Hide resolved

@jshier jshier added this to the 5.0.0.rc.1 milestone Aug 12, 2019

@cnoon
cnoon approved these changes Aug 12, 2019
Copy link
Member

left a comment

Looks good @jshier.

@jshier jshier merged commit 45a1d70 into master Aug 13, 2019

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details

@jshier jshier deleted the feature/unfrozen-httpmethod branch Aug 13, 2019

toomasr added a commit to toomasr/Alamofire that referenced this pull request Aug 19, 2019
Unfreeze HTTPMethod (Alamofire#2901)
* Make HTTPMethod a struct.

* Make HTTPMethod case-sensitive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.