This is an async-http-client based driver for Papyrus.
You can see the Papyrus documentation in the main repository.
You can install PapyrusAsyncHTTPClient using the Swift Package Manager.
.package(url: "https://github.com/joshuawright11/papyrus-async-http-client.git", from: "0.2.0")
You can use this Papyrus driver by importing it instead.
import PapyrusAsyncHTTPClient
Under the hood, PapyrusAsyncHTTPClient uses async-http-client to make requests. If you'd like to use a custom HTTPClient
for making requests, pass it in when initializing a Provider
.
let customClient: HTTPClient = ...
let provider = Provider(baseURL: "https://api.github.com", httpClient: customClient)
let github: GitHub = GitHubAPI(provider: provider)
If needbe, you can also access the under-the-hood HTTPClient
types on a Response
.
let response: Response = ...
let httpClientRequest: HTTPClient.Request = response.request
let httpClientResponse: HTTPClient.Response = response.response!
👋 Thanks for checking out Papyrus!
If you'd like to contribute please file an issue, open a pull request or start a discussion.
Papyrus is released under an MIT license. See License.md for more information.