-
Notifications
You must be signed in to change notification settings - Fork 6
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
Should network requests which aren't GET require data to be returned #40
Comments
We could add a protocol extension for the |
If you don't care about the data you can make the |
@Neil3079 I don't think we should add a default implementation since it's nice to have the compiler error when the method is not implemented. This case is only relevant when the |
@lucianomarisi Well we would still have the compiler error as the extension would only be on the case when the Model is |
ahh yes, makes sense, we could add something like this:
Not sure if the syntax is correct. |
I seem to remember in Swift |
You're correct, trying a bit of code in Xcode, this seems to work: public extension DataResourceType where Model == Void {
func model(from data: Data) throws {}
} This would be the defined resource: struct VoidResource: DataResourceType {
typealias Model = Void
} |
It's a pretty common pattern to just use status codes for some of the HTTP methods. For example, I want to send a push notification token to my server. I don't care about the response other than if it's a
200
or not as it's quite fire-and-forget.My understanding of the current Resource Loader implementation is that we need to return and parse some data even on
POST
etc.What do people think?
The text was updated successfully, but these errors were encountered: