HTTPBin 0.0.2

HTTPBin 0.0.2

Maintained by Ryan Baumbach.



HTTPBin 0.0.2

  • By
  • Ryan Baumbach

HTTPBin Cocoapod Version Swift Version SPM Compatible Cocoapod Platform iOS Deployment Target License

A Codable model for the httpbin api

Adding HTTPBin to your project

Clone from Github

  1. Clone repository from github and copy files directly, or add it as a git submodule.
  2. Add all files from Source directory to your project.

Usage

Anywhere you want to use a Codable HTTPBin.

    let networking = PequenoNetworking(baseURL: "https://httpbin.org")
    
    networking.get(endpoint: "/get",
                   parameters: nil) { (result: Result<HTTPBin, Error>) in
        let httpBin = try? result.get()
    }
    
    // or
    
    let httpBin = try? JSONDecoder().decode(HTTPBin.self, from: jsonData)

The above example uses PequenoNetworking from the Utensils project, but this can be used wherever you serialize, or deserialize json using the Codable apis.

Testing

This project has been setup to use fastlane to run the specs.

First, bundle required gems, install Cocoapods. Next, inside the root project directory run:

$ bundle
$ bundle exec pod install

And then use fastlane to run all the specs on the command line:

$ bundle exec fastlane integrationSpecs

Suggestions, requests, and feedback

Thanks for checking out Utensils. Any feedback, suggestions and feedback can be can be sent to: [email protected], or opened as a github issue.