swift-server/async-http-client

README.md async/await example does not compile

hwjeremy opened this issue · 1 comments

AsyncHTTPClient commit hash: 291438696abdd48d2a83b52465c176efbd94512b

Context:
When attempting to reproduce the example async/await example from README.md, an error occurs.

let request = HTTPClientRequest(url: "https://apple.com/")
let response = try await HTTPClient.shared.execute(    // --> `Type 'HTTPClient' has no member 'shared`
    request,
    timeout: .seconds(30)
)
// snip

Steps to reproduce:

  1. Copy/paste async/await example
  2. Attempt compilation

$ swift --version
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0

Operating system: macOS 14.4.1

I just tagged a new release https://github.com/swift-server/async-http-client/releases/tag/1.21.0 and the examples should now work.