Elegant API Abstraction for Swift

Related tags

Networking Endpoint
Overview

Endpoint (Deprecated)

โš ๏ธ This project has been deprecated. Consider using Moya and MoyaSugar instead.

Swift Build Status CocoaPods Carthage compatible

๐Ÿš€ Elegant API Abstraction for Swift.

At a Glance

API Declarations

Create an Enum with raw type Rule and conform protocol Endpoint. Each cases is the API endpoint which contains HTTP method and URL path.

enum GitHub: Rule, Endpoint {
    static var baseURLString = "https://api.github.com"

    case Repo        = "GET  /repos/
   
    /
    
     "
    
   
    case RepoIssues  = "GET  /repos/
   
    /
    
     /issues
     "
    
   
    case CreateIssue = "POST /repos/
   
    /
    
     /issues
     "
    
   
}
Using APIs

Endpoint is built on Alamofire. Calling request() on endpoint cases returns Alamofire.Request instance.

GitHub.Repo.request(["owner": "devxoul", "repo": "Then"]).responseJSON { response in
    // This is an Alamofire's response block!
}

This example is sending an HTTP request to https://api.github.com/repos/devxoul/Then using GET.

Installation

  • Using CocoaPods:

    pod 'Endpoint', '~> 0.2'
  • Using Carthage:

    0.2">
    github "devxoul/Endpoint" ~> 0.2
    
  • Using Swift Package Manager:

    import PackageDescription
    
    let package = Package(
        name: "MyAwesomeApp",
        dependencies: [
            .Package(url: "https://github.com/devxoul/Endpoint", "0.2.0"),
        ]
    )

License

Endpoint is under MIT license. See the LICENSE file for more info.

You might also like...
An elegant yet powerful iOS networking layer inspired by ActiveRecord.
An elegant yet powerful iOS networking layer inspired by ActiveRecord.

Written in Swift 5 AlamoRecord is a powerful yet simple framework that eliminates the often complex networking layer that exists between your networki

Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and moreโ€ฆ)
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and moreโ€ฆ)

Perfect: Server-Side Swift ็ฎ€ไฝ“ไธญๆ–‡ Perfect: Server-Side Swift Perfect is a complete and powerful toolbox, framework, and application server for Linux, iO

Quickstart-ios-swift-grpc - Quickstart for integrating Approov with iOS apps in Swift that make API requests you wish to protect using GRPC
Access Xcode Server API with native Swift objects.

Xcode Server SDK Use Xcode Server's API with native Swift objects. First brought to you in Buildasaur, now in an independent project. This is an unoff

A WIP Swift wrapper for Discord's Bot API.

Quickcord Quickcord is a WIP Swift wrapper for Discord's Bot API. Features (As of right now) Connecting the the gateway and identifying. Literally eve

An unofficial supported Swift client library for accessing News API.

An unofficial supported Swift client library for accessing News API.

Swift package for adding API Key requirement to vapor backends.

APIKeyMiddleware Swift package for adding API Key requirement to vapor backends. Features โœ… Supports an array of keys โœ… Supports overriding thrown err

A modern Swift wrapper for Instagram Private API.
A modern Swift wrapper for Instagram Private API.

Swiftagram is a wrapper for Instagram Private API, written entirely in (modern) Swift. Instagram's official APIs, both the Instagram Basic Display API

A lightweight generic networking API written purely in Swift

SwiftyNetworking SwiftyNetworking library is a generic networking library writte

Releases(0.1.0)
Owner
Suyeol Jeon
A lazy developer ๐Ÿ˜ด I write many code to write less code.
Suyeol Jeon
APIProvider - API Provider Package for easier API management inspired by abstraction

APIProvider Using APIProvider you can easily communicate with all API endpoints

null 1 Apr 21, 2022
Network abstraction layer written in Swift.

Moya 14.0.0 A Chinese version of this document can be found here. You're a smart developer. You probably use Alamofire to abstract away access to URLS

Moya 14.4k Jan 1, 2023
Network abstraction layer written in Swift.

Moya 15.0.0 A Chinese version of this document can be found here. You're a smart developer. You probably use Alamofire to abstract away access to URLS

Moya 14.4k Jan 4, 2023
Type-safe networking abstraction layer that associates request type with response type.

APIKit APIKit is a type-safe networking abstraction layer that associates request type with response type. // SearchRepositoriesRequest conforms to Re

Yosuke Ishikawa 1.9k Dec 30, 2022
Dratini is a neat network abstraction layer.

Dratini Dratini is a neat network abstraction layer. If you are looking for a solution to make your network layer neat, Dratini is your choice. Dratin

Kevin Lin 37 Jan 29, 2022
Lightweight network abstraction layer, written on top of Alamofire

TRON is a lightweight network abstraction layer, built on top of Alamofire. It can be used to dramatically simplify interacting with RESTful JSON web-

MLSDev 528 Dec 26, 2022
NSURLSession network abstraction layer, using Codable and Decodable for response and Encodable for request. โš™๏ธ๐Ÿš€

SONetworking NSURLSession network abstraction layer, using Codable and Decodable for response and Encodable for request. Project Folder and File Struc

Ahmad AlSofi 4 Jan 28, 2022
DBNetworkStack is a network abstraction for fetching request and mapping them to model objects

DBNetworkStack Main Features ?? Typed network resources ?? Value oriented architecture ?? Exchangeable implementations ?? Extendable API ?? Composable

DB Systel GmbH 33 Jan 10, 2022
Elegant HTTP Networking in Swift

Alamofire is an HTTP networking library written in Swift. Features Component Libraries Requirements Migration Guides Communication Installation Usage

Alamofire 38.7k Jan 8, 2023
Elegant NTP date library in Swift

Kronos is an NTP client library written in Swift. It supports sub-seconds precision and provides a stable monotonic clock that won't be affected by ch

Mobile Native Foundation 576 Jan 2, 2023