From 021c6572ec749af97a8927042f452392a01e1b23 Mon Sep 17 00:00:00 2001 From: Rich Hodgkins Date: Sun, 11 Jan 2015 13:38:29 +0000 Subject: [PATCH] Update README.md --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 402b497..5bf5b31 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,21 @@ # SwiftHTTPStatusCodes Swift enum wrapper for easier handling of HTTP status codes. + +All the [RF2616](http://www.ietf.org/rfc/rfc2616.txt) standard status codes are supported with a few added ones from the [Wikipedia page](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes). + +## Helper methods + +There are `Bool` properties on the enum for checking if a status code is of a certain category: +```swift +isInformational +isSuccess +isRedirection +isClientError +isServerError +``` + +There is also an extension on `NSHTTPURLResponse` to obtain a status code enum directly and to `init` with one: +```swift +var statusCodeValue: HTTPStatusCode? +init?(URL url: NSURL, statusCode: HTTPStatusCode, HTTPVersion: String?, headerFields: [NSObject : AnyObject]?) +```