Skip to content

RestPath

Norman Basham edited this page Feb 17, 2020 · 1 revision

RestPath

Source


Create REST URL paths with let path = RestPath("pets", 0). URL has a variant init extension that allows for N RestPath parameters e.g.

    let base = "http://localhost:3000"
    let url = URL(base: base, RestPath("vets", 0), RestPath("pets"))
    print(url.absoluteString) // http://localhost:3000/vets/0/pets
Clone this wiki locally