Releases: 3lvis/Networking
Releases · 3lvis/Networking
Networking — 0.20.0
Added a new method to cancel an image download using a full path, instead of a relative one.
func cancelImageDownload(fullPath path: String)
Networking — 0.19.0
- Fix
stringByAddingPercentEscapesUsingEncoding
deprecation - Improve support for links with strange characters, for example ø/å/ü and others
- Make POST parameters optional
- Added Carthage suport
NetworkActivityIndicator — 0.18.2
- Update TestCheck with fix for Xcode 7.3
Networking — 0.18.1
- Update for Swift 2.2
- Remove dependencies
Networking — 0.18.0
- Add a method to download an image by providing the full path. The main good thing about this is that the cache is shared.
public func downloadImage(fullPath path: String, completion: (image: UIImage?, error: NSError?) -> ())
- Fixed a 🐛 where failed photo downloads wouldn't return the error.
- Added support for custom
ContentType
s. Before it was only possible to useJSON
andFormURLEncoded
as theContentType
. Now when making a request you can provide anyContentType
!
let networking = Networking(baseURL: "http://httpbin.org")
networking.POST("/post", contentType: .Custom("MyMomLovesMe"), parameters: ["custname":"jameson"]) { JSON, error in
// Successfull post using `application/x-www-form-urlencoded` as `Content-Type`
}
Networking — 0.17.0
✨ NEW ✨ Custom authentication header
authenticate(authenticationHeader: "Token token=CUSTOM")
⚠️ Breaking changes ⚠️
Basic auth
Before:
authenticate("username", password: "password")
After:
authenticate(username: "username", password: "password")
Token
Before:
authenticate("token")
After:
authenticate(token: "token")
Networking — 0.16.0
⚠️ This release has a breaking change ⚠️
Replaces all stubbing methods with fake instead (#57):
stubGET
now isfakeGET
stubPOST
now isfakePOST
stubPUT
now isfakePUT
stubDELETE
now isfakeDELETE
stubImageDownload
now isfakeImageDownload
The reasoning behind this change is that it helps making this feature being more accessible to users that don’t need much introduction into what stubbing or mocking means.
Networking — 0.15.0
- Stubbing failures: Now you can provide a status code when stubbing endpoint calls, if the status code is 2XX the response object will be returned, otherwise we will return an NSError containing the status code and a proper description.
- NetworkingStatusCodeType: 0.15.0 introduces a new and nicer way to categorize status codes, now you can use the
statusCodeType()
method in any Int, it will return any of the following cases:
/**
Categorizes a status code.
- `Informational`: This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line.
- `Successful`: This class of status code indicates that the client's request was successfully received, understood, and accepted.
- `Redirection`: This class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request.
- `ClientError:` The 4xx class of status code is intended for cases in which the client seems to have erred.
- `ServerError:` Response status codes beginning with the digit "5" indicate cases in which the server is aware that it has erred or is incapable of performing the request.
- `Unknown:` This response status code could be used by Foundation for other types of states, for example when a request gets cancelled you will receive status code -999
*/
public enum NetworkingStatusCodeType {
case Informational, Successful, Redirection, ClientError, ServerError, Unknown
}
Networking — 0.14.2
- Fixed: Image cache wasn't using the right keys, hence it wasn't being used.
Networking — 0.14.1
- Improve logging with correct responses for different contentTypes