Latest 0.1.0
Homepage https://github.com/aaayia/AYINetwork
License MIT
Platforms ios 9.3
Dependencies Alamofire, SwiftyJSON
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

swift=’3.2′

Installation

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

pod 'AYINetwork'

Example

struct HTTPTarget: WKTarget {
    var baseURLString: String { return "http://127.0.0.1:8000" }
    var headers: [String : String] = [:]
}

class LoginRequest: WKRequest {
    let username = "zhangsan"
    let password = "12345678" 
    override func loadRequest() {
        super.loadRequest()
        self.path = "/login"
        self.method = .post
    }
}

struct User: Decodable {
    var id: Int
    var name: String
    var token: String
}

HTTPNetwork.request(LoginRequest()) { (response) in
            if let user = response.decode(to:User.self) {   
            }else if response.error != nil {
                //show error
            }
        }

Author

aaayia, [email protected]

License

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

Latest podspec

{
    "name": "AYINetwork",
    "version": "0.1.0",
    "summary": "u57fau4e8eAlamofireu7684u7f51u8defu5e93",
    "description": "u57fau4e8eAlamofireu7684u7f51u8defu5e93uff0cu91c7u7528u5206u6563u5f0fu7684u7f51u7edcu8bf7u6c42",
    "homepage": "https://github.com/aaayia/AYINetwork",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "aaayia": "[email protected]"
    },
    "source": {
        "git": "https://github.com/aaayia/AYINetwork.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "9.3"
    },
    "source_files": "AYINetwork/Classes/**/*",
    "swift_version": "3.2",
    "dependencies": {
        "Alamofire": [],
        "SwiftyJSON": [
            "~> 3.1.4"
        ]
    }
}

Pin It on Pinterest

Share This