YYHRequest-Swift alternatives and similar libraries
Based on the "Network" category.
Alternatively, view YYHRequest-Swift alternatives based on common mentions on social networks and blogs.
-
Perfect
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and moreβ¦) -
Reachability.swift
Replacement for Apple's Reachability re-written in Swift with closures -
swifter
Tiny http server engine written in Swift programming language. -
SwiftSoup
SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS) -
Netfox
A lightweight, one line setup, iOS / OSX network debugging library! π¦ -
SwiftHTTP
Thin wrapper around NSURLSession in swift. Simplifies HTTP requests. -
Siesta
The civilized way to write REST API clients for iOS / macOS -
CocoaMQTT
MQTT 5.0 client library for iOS and macOS written in Swift -
APIKit
Type-safe networking abstraction layer that associates request type with response type. -
SwiftSocket
The easy way to use sockets on Apple platforms -
Swifton
A Ruby on Rails inspired Web Framework for Swift that runs on Linux and OS X -
Zewo
Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines. -
ResponseDetective
Sherlock Holmes of the networking layer. :male_detective: -
SwiftWebSocket
A high performance WebSocket client library for swift. -
BlueSocket
Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux. -
Connectivity
π Makes Internet connectivity detection more robust by detecting Wi-Fi networks without Internet access. -
WKZombie
WKZombie is a Swift framework for iOS/OSX to navigate within websites and collect data without the need of User Interface or API, also known as Headless browser. It can be used to run automated tests / snapshots and manipulate websites using Javascript. -
Taylor
A lightweight library for writing HTTP web servers with Swift -
Pitaya
π A Swift HTTP / HTTPS networking library just incidentally execute on machines -
Blackfish
A minimal, fast and unopinionated web framework for Swift -
PeerKit
An open-source Swift framework for building event-driven, zero-config Multipeer Connectivity apps -
Express
Swift Express is a simple, yet unopinionated web application server written in Swift -
Heimdallr.swift
Easy to use OAuth 2 library for iOS, written in Swift. -
Embassy
Super lightweight async HTTP server library in pure Swift runs in iOS / MacOS / Linux -
Reach
A simple class to check for internet connection availability in Swift. -
Socks
π Non-blocking TCP socket layer, with event-driven server and client. -
Digger
Digger is a lightweight download framework that requires only one line of code to complete the file download task -
SOAPEngine
This generic SOAP client allows you to access web services using a your iOS app, Mac OS X app and AppleTV app. -
Transporter
A tiny library makes uploading and downloading easier -
SwiftyOAuth
A simple OAuth library for iOS with a built-in set of providers -
XcodeServerSDK
Access Xcode Server API with native Swift objects. -
Malibu
:surfer: Malibu is a networking library built on promises -
BigBrother
Automatically sets the network activity indicator for any performed request.
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of YYHRequest-Swift or a related project?
README
YYHRequest
YYHRequest
is a simple and lightweight class for loading asynchronous HTTP requests in Swift. Built on NSURLConnection
and NSOperationQueue
. YYHRequest
is not intended to be a full-featured networking framework but instead a simple wrapper to avoid the boilerplate of using NSURLConnection
and NSURLRequest
for simple networking tasks.
- Lightweight design - just a single wrapper class
- Avoid the boilerplate of
NSURLConnection
andNSURLRequest
for simple networking tasks - Simple API for setting request headers, query parameters, and form data
Original Objective-C version available here.
Getting Started
Create and load a request
let request = YYHRequest(url: NSURL(string: "http://www.google.com/"))
request.loadWithCompletion {response, data, error in
if let actualError = error {
// handle error
} else if let actualResponse = response {
// handle success
}
}
Create request and load manually.
let request = YYHRequest(url: NSURL(string: "http://www.google.com/"))
request.method = "POST"
request.parameters["foo"] = "bar"
request.completionHandler = { response, data, error in
// request complete!
}
request.loadRequest()
Usage
Load a Request
let request = YYHRequest(url: NSURL(string: "http://www.google.com/"))
request.loadWithCompletion { response, data, error in
// request complete!
}
HTTP
GET /
Customize a Request
// set request method
request.method = "PUT";
// set HTTP headers using headers dictionary
request.headers["User-Agent"] = "value"
// set header values via properties
request.userAgent = "value"
HTTP
PUT /
User-Agent: value
Content-Type: application/x-www-form-urlencoded
Sending Query Parameters
let request = YYHRequest(url: NSURL(string: "http://www.google.com/"))
request.parameters["foo"] = "bar"
HTTP
GET /?foo=bar
Posting Data
let request = YYHRequest(url: NSURL(string: "http://www.google.com/"))
request.method = "POST"
request.parameters["foo"] = "bar"
HTTP
POST /
Content-Type: application/x-www-form-urlencoded
foo=bar