-
Notifications
You must be signed in to change notification settings - Fork 125
add version to response #182
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! Just one nit
@@ -237,9 +239,27 @@ extension HTTPClient { | |||
/// - status: Response HTTP status. | |||
/// - headers: Reponse HTTP headers. | |||
/// - body: Response body. | |||
@available(*, deprecated, message: "please use init(host:status:version:headers:body:) instead") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a renamed: init(host:status:version:headers:body:)
which gives a better error message and makes Xcode generate fixits automatically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Add HTTP version to response struct. Closes #164
Motivation:
Servers are free to respond with different versions in some cases, clients need to have access to returned version.
Modifications:
Copy HTTP version from
.head
part toResponse
struct on init.Result:
Clients of the library now have access to returned HTTP version.