Skip to content

Commit 912005b

Browse files
vkillartemredkin
authored andcommitted
Add init to HTTPClient.Response (#75)
1 parent e64448e commit 912005b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Sources/AsyncHTTPClient/HTTPHandler.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,20 @@ extension HTTPClient {
179179
public var headers: HTTPHeaders
180180
/// Response body.
181181
public var body: ByteBuffer?
182+
183+
/// Create HTTP `Response`.
184+
///
185+
/// - parameters:
186+
/// - host: Remote host of the request.
187+
/// - status: Response HTTP status.
188+
/// - headers: Reponse HTTP headers.
189+
/// - body: Response body.
190+
public init(host: String, status: HTTPResponseStatus, headers: HTTPHeaders, body: ByteBuffer?) {
191+
self.host = host
192+
self.status = status
193+
self.headers = headers
194+
self.body = body
195+
}
182196
}
183197
}
184198

0 commit comments

Comments
 (0)