Skip to content

Releases: shortcut/NetworkKit

Data in data even if server responds with 0 bytes

28 May 17:41
4afc293
Compare
Choose a tag to compare
Merge pull request #27 from shortcut/dontCheckDataLength

Don't check count of received data

Empty data as success

06 Apr 14:41
7a6e18a
Compare
Choose a tag to compare

Allow the server to response with empty data

Disk request fixes, cancellation fixes, logging improvement

03 Mar 10:09
7a6e18a
Compare
Choose a tag to compare
Merge pull request #26 from shortcut/diskRequestFixes

Disk request fixes, cancellation fixes, logging improvement

0.1.5: Bug fix

04 Feb 12:41
15bd7b7
Compare
Choose a tag to compare

Fixed retain cycle on requests

0.1.4: Validation and custom error parsing

31 Jan 08:44
68f86ab
Compare
Choose a tag to compare
  • add better validation of requests
  • be able to specify a model type for error responses
    (details in README)

bux fixes

05 Dec 15:03
Compare
Choose a tag to compare
  • update internal urlRequest after going through all the RequestAdapters
  • actually use the jsonDecoder passed in
  • don't let Request retain the parent Network

Add RequestAdapter

27 Nov 12:58
Compare
Choose a tag to compare

New protocol for adding adapters (middleware) to a request:

public protocol RequestAdapter {
    func adapt(_ urlRequest: URLRequest) -> URLRequest
}

Request now has adapters: [RequestAdapter] and func withAdapter(_ adapter: RequestAdapter) -> Self which you can use to chain the addition of adapters

Example:

                network.request(OrderAPI.getOrders)
                    .withAdapter(AuthenticationAdapter(accessToken: accessToken))
                    .responseDecoded(of: OrderResponse.self)

Fixes DiskRequest and adds TargetType properties for mock data

25 Nov 14:13
4894962
Compare
Choose a tag to compare

TargetType protocol now includes:

    var diskPath: String? { get } // for mocks using DiskRequest
    var diskDelay: TimeInterval { get }

in order for a target to define a local json file for the request, and an optional delay (to test loading UI for example)

New Network API

06 Nov 10:52
a9d89ce
Compare
Choose a tag to compare

This release introduces an almost complete rewrite of the API. See README for more info

0.0.3: Merge pull request #11 from shortcut/andre/queryOptions

22 Oct 12:29
4c27019
Compare
Choose a tag to compare
add ability to configure query string format for arrays and dictionaries