We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90ca4d7 commit e3e7f31Copy full SHA for e3e7f31
Examples/DeleteJSON/DeleteJSON.swift
@@ -6,7 +6,7 @@ import NIOFoundationCompat
6
@main
7
struct DeleteJSON {
8
static func main() async throws {
9
- let httpClient = HTTPClient(eventLoopGroupProvider: .singleton)
+ let httpClient = HTTPClient.shared
10
11
do {
12
var request = HTTPClientRequest(url: "http://localhost:8080/todos/1)")
@@ -17,7 +17,5 @@ struct DeleteJSON {
17
} catch {
18
print("request failed:", error)
19
}
20
- // it is important to shutdown the httpClient after all requests are done, even if one failed
21
- try await httpClient.shutdown()
22
23
0 commit comments