Releases: 3lvis/Networking
Releases · 3lvis/Networking
Networking — 2.0.0 (Beta 1)
Initial Swift 3 migration using Xcode 8 (Beta 1).
Networking — 2.0.0 (Beta 2)
Improved Swift 3 migration using Xcode 8 (Beta 1).
Networking — 1.1.0
Multipart
More information: https://github.com/3lvis/Networking#multipart
Example:
let networking = Networking(baseURL: "https://example.com")
let part1 = FormDataPart(data: imageData1, parameterName: "file1", filename: "selfie1.png")
let part2 = FormDataPart(data: imageData2, parameterName: "file2", filename: "selfie2.png")
let parameters = ["username" : "3lvis"]
networking.POST("/image/upload", parts: [part1, part2], parameters: parameters) { JSON, error in
// Do something
}
Custom authorization header
More information: https://github.com/3lvis/Networking#custom-authentication-header
Example:
let networking = Networking(baseURL: "http://httpbin.org")
networking.authenticate(headerKey: "Anonymous-Token", headerValue: "AAAFFAAAA3DAAAAAA")
networking.GET("/get") { JSON, error in
// Do something
}
Networking — 1.0.1
- Improved OS X unit tests
- Added support for NSImage
Networking — 1.0.0
Important
This marks the first stable release of Networking
. Expect strict semantic versioning releases after this. 🎉
Changes
- Renamed
ContentType
toParameterType
The
Content-Type
HTTP specification is so unfriendly, you have to know the specifics of it before understanding that content type is really just the parameter type. Because of this Networking uses aParameterType
instead of aContentType
. Anyway, here's hoping this makes it more human friendly.
destinationURL
now throws so usetry networking.destinationURL(...)
instead
Networking — 0.25.0
Networking — 0.24.0
- Add support for retrieving an image from the cache
networking.imageFromCache("/image/png") { image in
// Image from cache, you will get `nil` if no image is found
}
Networking — 0.23.0
- Add support for cancelling all the in-progress requests
Networking — 0.22.0
- Improve cache handling
- Fix issues with supporting cache names that use
/
Networking — 0.21.0
- Remove full path image download support
This was causing a few headaches and it was very inconsistent since you need a base url to start an instance of Networking. Anyway, to alleviate this issues (meaning the fact that you have a full url, instead of a base url and a relative path) we have introduced a new utility method. - Split a full url into base url and relative url
public static func splitBaseURLAndRelativePath(path: String) -> (baseURL: String, relativePath: String)
How to use:
let (baseURL, relativePath) = Networking.splitBaseURLAndRelativePath("http://httpbin.org/basic-auth/user/passwd")
// baseURL ~> "http://httpbin.org"
// relativePath ~> "/basic-auth/user/passwd"
- Add support for custom cache name.
Downloading an image was using caching by default, caching was done using the downloaded url, a lot of times you want to cache using something different, though, that's why we have introduced a new parameter to provide a cache name when downloading images. If you don't provide a cache name the url will be used.