diff --git a/README.md b/README.md index 4c32e9c..124386c 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ ws.get("/users").then { json in ## Swift Version Swift 2 -> version **1.3.0** ios8+ -Swift 3 -> version **2.0.0** ios9+ +Swift 3 -> version **2.0.1** ios8+ ## Why @@ -208,6 +208,24 @@ existingArticle.delete().then { } ``` + +### HTTP Status code + +When a request fails, we often want to know the reason thanks to the HTTP status code. +Here is how to get it : + +```swift +ws.get("/users").then { + // Do something +}.onError { e in + if let wsError = e as? WSError { + print(wsError.status) + print(wsError.status.rawValue) // RawValue for Int status + } +} +``` +You can find the full `WSError` enum here -> https://github.com/freshOS/ws/blob/master/ws/WSError.swift + ## Bonus - Load More pattern Very often we deal we lists and the ability to `load more` items. diff --git a/ws.framework.zip b/ws.framework.zip new file mode 100644 index 0000000..4a7200f Binary files /dev/null and b/ws.framework.zip differ diff --git a/ws.podspec b/ws.podspec index 9899fe9..bcc6718 100644 --- a/ws.podspec +++ b/ws.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "ws" - s.version = "2.0.0" + s.version = "2.0.1" s.summary = "Elegant JSON WebService for Swift ☁️" s.homepage = "https://github.com/freshOS/ws" s.license = { :type => "MIT", :file => "LICENSE" } diff --git a/ws/Info.plist b/ws/Info.plist index 7e7479f..783e22e 100644 --- a/ws/Info.plist +++ b/ws/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.0.0 + 2.0.1 CFBundleSignature ???? CFBundleVersion