GithubHelp home page GithubHelp logo

mitchellporter / weblinking.swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kylef-archive/weblinking.swift

0.0 0.0 0.0 30 KB

Swift implementation of web linking (RFC5988)

License: MIT License

Swift 88.16% Objective-C 4.96% Ruby 6.88%

weblinking.swift's Introduction

# Web Linking

Swift implementation of Web Linking (RFC5988).

Installation

CocoaPods is the recommended installation method.

pod 'WebLinking'

Example

Given the following Link header on an NSHTTPURLResponse.

Link: <https://api.github.com/user/repos?page=3&per_page=100>; rel="next",
      <https://api.github.com/user/repos?page=50&per_page=100>; rel="last"

We can find the next link on a response:

if let link = response.findLink(relation: "next") {
  print("We have a next link with the URI: \(link.uri).")
}

Or introspect all available links:

for link in response.links {
  print("We have a link with the relation: \(link.relationType) to \(link.uri).")
}

License

Web Linking is licensed under the MIT license. See LICENSE for more info.

weblinking.swift's People

Contributors

kylef avatar steam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.