All Projects → glassonion1 → R9HTTPRequest

glassonion1 / R9HTTPRequest

Licence: MIT license
HTTP Client

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

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'
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].