Skip to content

Commit 40f2baf

Browse files
committed
update
1 parent 970f424 commit 40f2baf

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

Sources/async-http-client/proxy/http/Configuration.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ public extension Http{
1212
/// Configuration http client
1313
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
1414
struct Configuration<R: IReader, W: IWriter>: IConfiguration, @unchecked Sendable{
15-
15+
16+
// MARK: - Config
17+
1618
/// Base url
1719
public var baseURL: URL
1820

@@ -29,10 +31,14 @@ public extension Http{
2931

3032
/// Writer
3133
public let writer: W
32-
34+
35+
// MARK: - Private properties
36+
3337
/// An object that coordinates a group of related, network data transfer task
3438
private let session : URLSession
3539

40+
// MARK: - Life circle
41+
3642
/// - Parameters:
3743
/// - reader: Reader
3844
/// - writer: Writer
@@ -77,6 +83,8 @@ public extension Http{
7783
public extension Http.Configuration where R == JsonReader, W == JsonWriter {
7884

7985
/// Create configuration by base url
86+
/// URLSession is URLSession.shared
87+
/// Reader amd Writer for Json format
8088
/// - Parameter baseURL: Base url
8189
init(baseURL: URL) {
8290
self.reader = JsonReader()

Sources/async-http-client/proxy/http/Response.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ public extension Http{
1313
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
1414
struct Response<T> : IResponse, @unchecked Sendable{
1515

16+
/// Status code
17+
public var statusCode: Int? {
18+
(urlResponse as? HTTPURLResponse)?.statusCode
19+
}
20+
21+
// MARK: - Config
22+
1623
/// Instances of a data
1724
public let value: T
1825

@@ -24,11 +31,9 @@ public extension Http{
2431

2532
/// Request
2633
public let urlRequest: URLRequest
27-
28-
/// Status code
29-
public var statusCode: Int? {
30-
(urlResponse as? HTTPURLResponse)?.statusCode
31-
}
34+
35+
36+
// MARK: - Life circle
3237

3338
/// The metadata associated with the response to a URL load request
3439
/// - Parameters:

0 commit comments

Comments
 (0)