🌿 Human readable HTTP request in Swift.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Assets
Mint/Core
Sample
.gitignore
LICENSE.md
Mint.podspec
README.adoc
README.html
_config.yml

README.adoc

Meet Mint

Mint

Author EMail MIT
Version Platforms Swift
Build Passing Cocoapods Carthage SPM

🏵 Introduction

Mint is a human readable HTTP request library in Swift.

📋 Requirements

Type Requirement

Platform

iOS

9.0+

macOS

10.11

tvOS

9.0

watchOS

2.0

Linux

N/A

IDE

Xcode

9.3+

Language

Swift

4.1+

📲 Installation

CocoaPods

Mint is available on CocoaPods.

use_frameworks!
pod 'Mint'

Manually

Copy all files in the Mint directory into your project.

🛌 Dependency

N/A

❤️ Contribution

You are welcome to fork and submit pull requests.

🔖 License

Mint is open-sourced software, licensed under the MIT license.

🔫 Usage

import Mint

let mint = Mint.init(baseURL: "https://meniny.cn/api/v2/")

mint.request("portfolio_repos.json", method: .get, parameter: .none, completion: { (data, resp) in
    print(String.init(data: data, encoding: .utf8) ?? "nil", resp.statusCode)
}, failure: { error, resp in
    print(error.localizedDescription, resp.statusCode)
})
import Mint

let mint = Mint.init(baseURL: "https://meniny.cn/api/v2/")

mint.get("blogroll.json") { (result: Mint.JSONResult) in
    switch result {
    case .success(let json, _):
        print(json.dictionary)
    case .failure(let error, let response):
        print(error.localizedDescription, response.statusCode)
    }
}
import Mint

let downloader = Mint.init(baseURL: "https://meniny.cn/assets/images/")

downloader.downloadImage("fire.jpg") { (result) in
    switch result {
    case .success(let image, _):
        print(image)
    case .failure(let error, let response):
        print(error, response.statusCode)
    }
}