HttpResponse
@objc(BMPHttpResponse)
@objcMembers
public final class HttpResponse : NSObject, @unchecked Sendable
Represents an HTTP response.
-
Corresponding HTTP request object of the response.
Declaration
Swift
public let request: HttpRequest
-
URL of the actual request. May differ from
request.url
when redirects have happened.Declaration
Swift
public let url: URL
-
HTTP status code of the response.
Declaration
Swift
public var status: Int
-
HTTP headers of the response.
Declaration
Swift
public var headers: [String : String]
-
HTTP response body.
Declaration
Swift
public var body: Data?
-
Creates a new HTTP response.
Declaration
Swift
public init(request: HttpRequest, url: URL, status: Int, headers: [String : String] = [:], body: Data? = nil)
Parameters
request
Corresponding HTTP request object of the response.
url
URL of the actual request. May differ from
request.url
when redirects have happened.status
HTTP status code of the response.
headers
HTTP headers of the response.
body
HTTP response body.