Latest 0.2.1
Homepage https://github.com/richardpiazza/DynuREST
License MIT
Platforms osx 10.12, ios 10.0, tvos 10.0, watchos 3.0, requires ARC
Dependencies CodeQuickKit
Frameworks Foundation
Authors

Version
Platform

Face it… a REST API that responds in only text doesn’t feel very modern. DynuREST attempts to translate the text responses from the Dynu.com IP Update API into propery HTTP status codes and meaningful errors.

API.swift

Provides a wrapper around CodeQuickKit.WebAPI that expands for a username/password credential combination. The update() function will execute the query and parse the ResponseCode returned.

Typical use:

let api = API(username: "username", password: "password")
api.update(ip: "127.0.0.1") { (statusCode, headers, data, error) in
    guard error == nil else {
        // Process Error
        return
    }

    guard statusCode < 300 else {
        // Non-OK response
        return
    }

    // All good
}

Insecure use:

The current version of the api.dynu.com SSL Certificate does not work with iOS11.0 and macOS10.13. In order to execute updates, an insecure HTTP connection must be used. In order to use this connection, your app must explicitly bypass App Transport Security in your Info.plist.

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>api.dynu.com</key>
        <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
</dict>

ResponseCode.swift

A reprsentation of the status codes that should be returned from the Dynu.com API. Use the init(stringValue:) with the test response fo parse the correct response.

String.swift

An extension of Swift.String with regex pattern matching of IPv4 and IPv6 address.

Latest podspec

{
    "name": "DynuREST",
    "version": "0.2.1",
    "summary": "An API wrapper for the Dynu.com IP Update API which attempts to model text responses to HTTP Status Codes.",
    "description": "Face it... a REST API that responds in only text doesn't feel very modern. DynuREST attempts to translate the textnresponses from the Dynu.com IP Update API into propery HTTP status codes and meaningful errors.",
    "homepage": "https://github.com/richardpiazza/DynuREST",
    "license": "MIT",
    "authors": {
        "Richard Piazza": "[email protected]"
    },
    "social_media_url": "https://twitter.com/richardpiazza",
    "source": {
        "git": "https://github.com/richardpiazza/DynuREST.git",
        "tag": "0.2.1"
    },
    "source_files": "Sources/*",
    "requires_arc": true,
    "platforms": {
        "osx": "10.12",
        "ios": "10.0",
        "tvos": "10.0",
        "watchos": "3.0"
    },
    "frameworks": "Foundation",
    "dependencies": {
        "CodeQuickKit": [
            "~> 5.0"
        ]
    },
    "pushed_with_swift_version": "4.04.04.04.0"
}

Pin It on Pinterest

Share This