Skip to content

Commit d7f2a39

Browse files
Andrew-Lees11artemredkin
authored andcommitted
fix compile errors in README example (#53)
1 parent a076303 commit d7f2a39

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ httpClient.execute(request: request, timeout: timeout)
111111
### Streaming
112112
When dealing with larger amount of data, it's critical to stream the response body instead of aggregating in-memory. Handling a response stream is done using a delegate protocol. The following example demonstrates how to count the number of bytes in a streaming response body:
113113
```swift
114-
class CountingDelegate: HTTPResponseDelegate {
114+
class CountingDelegate: HTTPClientResponseDelegate {
115115
typealias Response = Int
116116

117117
var count = 0
@@ -152,7 +152,7 @@ class CountingDelegate: HTTPResponseDelegate {
152152
}
153153
}
154154

155-
let request = try HTTPRequest(url: "https://swift.org")
155+
let request = try HTTPClient.Request(url: "https://swift.org")
156156
let delegate = CountingDelegate()
157157

158158
try httpClient.execute(request: request, delegate: delegate).future.whenSuccess { count in

0 commit comments

Comments
 (0)