HTTP Client
Swift Ruby Objective-C
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R9HTTPRequest.xcodeproj
R9HTTPRequest.xcworkspace
R9HTTPRequest
R9HTTPRequestTests
.gitignore
.swift-version
.travis.yml
LICENSE
Podfile
Podfile.lock
R9HTTPRequest.podspec
README.md

README.md

R9HTTPRequest

Version License Platform Build Status

R9HTTPRequest is an easy to use wrapper around the URLSession(a.k.a NSURLSession) API that makes some of the more tedious aspects of communicating with web servers easier. It's backed by RxSwift and RxCocoa.

Feature

REST API Client

It is suitable performing basic HTTP requests and interacting with REST-based services (GET / POST / PUT / DELETE).

let disposeBag = DisposeBag()

let client = HttpJsonClient<HttpResponse>()
let url = URL(string: "http://httpbin.org/get")!

client.get(url: url, headers: nil)
    .subscribe(onNext: { response -> Void in
        //
    }).disposed(by: disposeBag)

struct HttpResponse: Codable {
    var id = ""
    var name = ""

    // ... //
}

Installation

CocoaPods

You can install R9HTTPRequest via CocoaPods by adding it to your Podfile:

use_frameworks!

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'

pod 'R9HTTPRequest'