Created
January 20, 2021 09:04
-
-
Save jaekong/46e3e09daba36af709043c5dccab750e to your computer and use it in GitHub Desktop.
A simple extension for Vapor 4 to tell if the request was accepted or not.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vapor | |
extension ClientResponse { | |
var ok: Bool { | |
get { | |
return self.status.code >= 200 && self.status.code < 300 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment