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.urlwhen 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
requestCorresponding HTTP request object of the response.
urlURL of the actual request. May differ from
request.urlwhen redirects have happened.statusHTTP status code of the response.
headersHTTP headers of the response.
bodyHTTP response body.
HttpResponse Class Reference