RESTRequest 0.4.1

RESTRequest 0.4.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jul 2016
SPMSupports SPM

Maintained by muukii, muukii.



 
Depends on:
BrickRequest~> 0.4.0
SwiftyJSON~> 2.3.1
RxSwift~> 2.0
 

  • By
  • muukii

RESTRequest

Example usage of BrickRequest.

RESTRequest’s dependencies.

  • BrickRequest (Good architecture for Alamofire)
  • Alamofire (Request core)
  • RxSwift (Dispatch, AutoRetry with reachability)
  • SwiftyJSON (Response, Request parameters)

Usage

Define Requests

  • GET
struct GetUsers: GETRequestType {
  var path: String {
    return "/user"
  }

  var parameterJSON: JSON {
    let json = JSON([
      "limit" : 10,
      "page" : 1,
    ])
    return json
  }
}

Dispatch Requests

let context = GetUsers()
_ = context.resume().subscribeNext { json in
    // response
}

Requirements

Installation

RESTRequest is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "RESTRequest"

Author

muukii, [email protected]

License

RESTRequest is available under the MIT license. See the LICENSE file for more info.