Latest 2.0.1
Homepage https://github.com/glassonion1/R9HTTPRequest
License MIT
Platforms ios 11.0, requires ARC
Dependencies RxSwift, RxCocoa
Authors

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'

Latest podspec

{
    "name": "R9HTTPRequest",
    "version": "2.0.1",
    "summary": "HTTP client",
    "description": "HTTP client",
    "homepage": "https://github.com/glassonion1/R9HTTPRequest",
    "license": "MIT",
    "authors": {
        "Taisuke Fujita": "[email protected]"
    },
    "platforms": {
        "ios": "11.0"
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/glassonion1/R9HTTPRequest.git",
        "tag": "2.0.1"
    },
    "source_files": "R9HTTPRequest/**/*.{h,m,swift}",
    "dependencies": {
        "RxSwift": [
            "~> 4.0.0"
        ],
        "RxCocoa": [
            "~> 4.0.0"
        ]
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This