SWNetworking is an easy to use Swift HTTP client built with CocoaAsyncSockets
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.
Networking.xcodeproj
Networking.xcworkspace
Networking
NetworkingTests
.travis.yml
Jenkinsfile
LICENSE
Podfile
README.md
SPHWNetworking.podspec

README.md

Build Status

SPHWNetworking

SWNetworking is an easy to use Swift HTTP client built with CocoaAsyncSockets. It is in the alpha stages and as such the API is going to change. It was built for Intercept and RESTer

Install


SPHWNetworking can be installed easily via Cocoa Pods

pod 'SPHWNetworking'

Usage


The basic usage of it is simple. You first create a request object, and to set a URL; then a method.

var request = Request()
request.url = "http://google.com"
request.method = .GET

`Then you can setup the body, which can come in two forms NSData or a string. The NSData takes precedent over the string

request.dataBody = NSData()

OR

request.body = "FOO"

Last but not least you setup your networking request.

let netRequest = NetworkingRequest(request, jar: CookieJar(), progressCB: {
progress in
// Do stuff with the progress
}) { response, body in
// Do stuff with the resulting jar and response
}
netRequest.run()