Structureswift-package-manager 6.0.3Basics
HTTPClientResponse
HTTPClientResponse.swift:15struct HTTPClientResponse
struct HTTPClientResponse
import Basics
protocol Sendable
init(statusCode: Int, statusText: String? = nil, headers: HTTPClientHeaders = .init(), body: Data? = nil)
static func notFound(reason: String? = nil) -> HTTPClientResponse
static func okay(body: Data?) -> HTTPClientResponse
static func okay(body: String? = nil) -> HTTPClientResponse
static func serverError(reason: String? = nil) -> HTTPClientResponse
let body: Data?
let headers: HTTPClientHeaders
let statusCode: Int
let statusText: String?
func decodeBody<T>(_ type: T.Type, using decoder: JSONDecoder = .init()) throws -> T? where T : Decodable