Skip to content

Releases: 3lvis/Networking

Networking — 2.0.0 (Beta 1)

29 Jun 22:18
Compare
Choose a tag to compare
Pre-release

Initial Swift 3 migration using Xcode 8 (Beta 1).

Networking — 2.0.0 (Beta 2)

06 Jul 07:37
Compare
Choose a tag to compare
Pre-release

Improved Swift 3 migration using Xcode 8 (Beta 1).

Networking — 1.1.0

22 May 16:11
Compare
Choose a tag to compare

Multipart

More information: https://github.com/3lvis/Networking#multipart

Issues: #101 #100 #94

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

Issues: #97 #98

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

14 May 19:02
Compare
Choose a tag to compare
  • Improved OS X unit tests
  • Added support for NSImage

Networking — 1.0.0

14 May 13:09
Compare
Choose a tag to compare

Important

This marks the first stable release of Networking. Expect strict semantic versioning releases after this. 🎉

giphy 1


Changes

  • Renamed ContentType to ParameterType

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 a ParameterType instead of a ContentType. Anyway, here's hoping this makes it more human friendly.

  • destinationURL now throws so use try networking.destinationURL(...) instead

Networking — 0.25.0

09 May 12:57
Compare
Choose a tag to compare
  • Added method to download data by @elland (#80) 👏
let networking = Networking(baseURL: self.baseURL)
networking.downloadData("/image/png") { data, error in
    // Do something with data!
}

Networking — 0.24.0

03 May 22:33
Compare
Choose a tag to compare
  • 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

26 Apr 14:36
Compare
Choose a tag to compare
  • Add support for cancelling all the in-progress requests

Networking — 0.22.0

24 Apr 08:05
Compare
Choose a tag to compare
  • Improve cache handling
  • Fix issues with supporting cache names that use /

Networking — 0.21.0

20 Apr 19:45
Compare
Choose a tag to compare
  • 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.