Latest 1.0
License MIT
Platforms ios 8.0
Dependencies Moya/RxSwift, HandyJSON

Moya + HandyJSON + LazyProvider

What’s LazyProvider?

  • request same url with same parameters multiple times, LazyProvider will use cache after the first.
  • request same url with same parameters thousand of times at the same time, it’s ok, LazyProvider will manage this.

MoyaProvider<GitHub>() Moya basic Provier

GitHub.provider() Normal request, but cache response

GitHub.lazyProvider() Use cache response if exists, or request then cache response


pod 'MoyaPlusHandyJSON'


// HanyJOSN extension with RxSwift
            .subscribe(onSuccess: { user in
                print("nname:(!) id:( url:(user.url!)")
            }) { error in
            }.disposed(by: bag)
// HanyJOSN extension with MoyaResponse
    .request(.userProfile("winddpan")) { result in
        switch result {
        case let .success(moyaResponse):
            let data =
            let statusCode = moyaResponse.statusCode
            let user = try!

            print("nname:(!) id:( url:(user.url!)")
        // do something with the response data or statusCode
        case let .failure(error):
            // this means there was a network failure - either the request
            // wasn't sent (connectivity), or no response was received (server
            // timed out).  If the server responds with a 4xx or 5xx error, that
            // will be sent as a ".success"-ful response.

Latest podspec

    "name": "MoyaPlusHandyJSON",
    "version": "1.0",
    "summary": "MoyaPlusHandyJSON Extension",
    "description": "Moya + HandyJSON + Lazy Provider",
    "homepage": "",
    "platforms": {
        "ios": "8.0"
    "license": "MIT",
    "authors": {
        "winddpan": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0"
    "source_files": [
    "dependencies": {
        "Moya/RxSwift": [
            "~> 11.0"
        "HandyJSON": [
            "~> 4.0.0-beta.1"

Pin It on Pinterest

Share This