Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Meniny/Mint
🌿 Human readable HTTP request in Swift.
https://github.com/Meniny/Mint
html http ios macos multipartform-data networking request tvos urlsession watchos
Last synced: 2 months ago
JSON representation
🌿 Human readable HTTP request in Swift.
- Host: GitHub
- URL: https://github.com/Meniny/Mint
- Owner: Meniny
- License: mit
- Created: 2018-05-19T10:03:24.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-19T16:38:10.000Z (over 6 years ago)
- Last Synced: 2024-10-13T14:27:07.249Z (2 months ago)
- Topics: html, http, ios, macos, multipartform-data, networking, request, tvos, urlsession, watchos
- Language: Swift
- Size: 129 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE.md
Awesome Lists containing this project
README
:name: Mint
:author: Elias Abel
:author_esc: Elias%20Abel
:mail: [email protected]
:desc: a human readable HTTP request library in Swift
:icon: {name}.png
:version: 2.0.0
:na: N/A
:ios: 9.0
:macos: 10.11
:watchos: 2.0
:tvos: 9.0
:linux: {na}
:xcode: 9.3
:swift: 4.1
:license: MIT
:sep: %20%7C%20
:platform: iOS{sep}macOS{sep}watchOS{sep}tvOS
// :toc: right
:source-highlighter: highlightjs
= Meet `{name}`
{author} <{mail}>
v{version}, 2018-05-19[subs="attributes"]
++++
++++== 🏵 Introduction
**{name}** is {desc}.
== 📋 Requirements
[%header]
|===
2+^m|Type 1+^m|Requirement1.5+^.^|Platform ^|iOS ^|{ios}+
^|macOS ^|{macos}
^|tvOS ^|{tvos}
^|watchOS ^|{watchos}
^|Linux ^|{linux}^|IDE ^|Xcode ^| {xcode}+
^|Language ^|Swift ^| {swift}+
|===== 📲 Installation
=== CocoaPods
`{name}` is available on link:https://cocoapods.org[CocoaPods].
[source, ruby, subs="verbatim,attributes"]
----
use_frameworks!
pod '{name}'
----=== Manually
Copy all files in the `{name}` directory into your project.
== 🛌 Dependency
{na}
== ❤️ Contribution
You are welcome to fork and submit pull requests.
== 🔖 License
`{name}` is open-sourced software, licensed under the link:./LICENSE.md[`{license}`] license.
== 🔫 Usage
[source, swift, subs="verbatim,attributes"]
----
import {name}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)
})
----[source, swift, subs="verbatim,attributes"]
----
import {name}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)
}
}
----[source, swift, subs="verbatim,attributes"]
----
import {name}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)
}
}
----