HTTPResponseStatus

public struct HTTPResponseStatus: Equatable, CustomStringConvertible, ExpressibleByIntegerLiteral

The response status for the HTTP response

  • The status code, eg. 200 or 404

    Declaration

    Swift

    public let code: Int
  • The reason phrase for the status code

    Declaration

    Swift

    public let reasonPhrase: String
  • Creates an HTTP response status

    Declaration

    Swift

    public init(code: Int, reasonPhrase: String)

    Parameters

    code

    The status code used for the response status

    reasonPhrase

    The reason phrase to use for the response status

  • Creates an HTTP response status The reason phrase is added for the status code, or http_(code) if the code is not well known

    Declaration

    Swift

    public init(code: Int)

    Parameters

    code

    The status code used for the response status

  • 100 Continue

    Declaration

    Swift

    public static let `continue` = HTTPResponseStatus(code: 100)
  • 101 Switching Protocols

    Declaration

    Swift

    public static let switchingProtocols = HTTPResponseStatus(code: 101)
  • ok

    200 OK

    Declaration

    Swift

    public static let ok = HTTPResponseStatus(code: 200)
  • 201 Created

    Declaration

    Swift

    public static let created = HTTPResponseStatus(code: 201)
  • 202 Accepted

    Declaration

    Swift

    public static let accepted = HTTPResponseStatus(code: 202)
  • 203 Non-Authoritative Information

    Declaration

    Swift

    public static let nonAuthoritativeInformation = HTTPResponseStatus(code: 203)
  • 204 No Content

    Declaration

    Swift

    public static let noContent = HTTPResponseStatus(code: 204)
  • 205 Reset Content

    Declaration

    Swift

    public static let resetContent = HTTPResponseStatus(code: 205)
  • 206 Partial Content

    Declaration

    Swift

    public static let partialContent = HTTPResponseStatus(code: 206)
  • 207 Multi-Status

    Declaration

    Swift

    public static let multiStatus = HTTPResponseStatus(code: 207)
  • 208 Already Reported

    Declaration

    Swift

    public static let alreadyReported = HTTPResponseStatus(code: 208)
  • 226 IM Used

    Declaration

    Swift

    public static let imUsed = HTTPResponseStatus(code: 226)
  • 300 Multiple Choices

    Declaration

    Swift

    public static let multipleChoices = HTTPResponseStatus(code: 300)
  • 301 Moved Permanently

    Declaration

    Swift

    public static let movedPermanently = HTTPResponseStatus(code: 301)
  • 302 Found

    Declaration

    Swift

    public static let found = HTTPResponseStatus(code: 302)
  • 303 See Other

    Declaration

    Swift

    public static let seeOther = HTTPResponseStatus(code: 303)
  • 304 Not Modified

    Declaration

    Swift

    public static let notModified = HTTPResponseStatus(code: 304)
  • 305 Use Proxy

    Declaration

    Swift

    public static let useProxy = HTTPResponseStatus(code: 305)
  • 307 Temporary Redirect

    Declaration

    Swift

    public static let temporaryRedirect = HTTPResponseStatus(code: 307)
  • 308 Permanent Redirect

    Declaration

    Swift

    public static let permanentRedirect = HTTPResponseStatus(code: 308)
  • 400 Bad Request

    Declaration

    Swift

    public static let badRequest = HTTPResponseStatus(code: 400)
  • 401 Unauthorized

    Declaration

    Swift

    public static let unauthorized = HTTPResponseStatus(code: 401)
  • 402 Payment Required

    Declaration

    Swift

    public static let paymentRequired = HTTPResponseStatus(code: 402)
  • 403 Forbidden

    Declaration

    Swift

    public static let forbidden = HTTPResponseStatus(code: 403)
  • 404 Not Found

    Declaration

    Swift

    public static let notFound = HTTPResponseStatus(code: 404)
  • 405 Method Not Allowed

    Declaration

    Swift

    public static let methodNotAllowed = HTTPResponseStatus(code: 405)
  • 406 Not Acceptable

    Declaration

    Swift

    public static let notAcceptable = HTTPResponseStatus(code: 406)
  • 407 Proxy Authentication Required

    Declaration

    Swift

    public static let proxyAuthenticationRequired = HTTPResponseStatus(code: 407)
  • 408 Request Timeout

    Declaration

    Swift

    public static let requestTimeout = HTTPResponseStatus(code: 408)
  • 409 Conflict

    Declaration

    Swift

    public static let conflict = HTTPResponseStatus(code: 409)
  • 410 Gone

    Declaration

    Swift

    public static let gone = HTTPResponseStatus(code: 410)
  • 411 Length Required

    Declaration

    Swift

    public static let lengthRequired = HTTPResponseStatus(code: 411)
  • 412 Precondition Failed

    Declaration

    Swift

    public static let preconditionFailed = HTTPResponseStatus(code: 412)
  • 413 Payload Too Large

    Declaration

    Swift

    public static let payloadTooLarge = HTTPResponseStatus(code: 413)
  • 414 URI Too Long

    Declaration

    Swift

    public static let uriTooLong = HTTPResponseStatus(code: 414)
  • 415 Unsupported Media Type

    Declaration

    Swift

    public static let unsupportedMediaType = HTTPResponseStatus(code: 415)
  • 416 Range Not Satisfiable

    Declaration

    Swift

    public static let rangeNotSatisfiable = HTTPResponseStatus(code: 416)
  • 417 Expectation Failed

    Declaration

    Swift

    public static let expectationFailed = HTTPResponseStatus(code: 417)
  • 421 Misdirected Request

    Declaration

    Swift

    public static let misdirectedRequest = HTTPResponseStatus(code: 421)
  • 422 Unprocessable Entity

    Declaration

    Swift

    public static let unprocessableEntity = HTTPResponseStatus(code: 422)
  • 423 Locked

    Declaration

    Swift

    public static let locked = HTTPResponseStatus(code: 423)
  • 424 Failed Dependency

    Declaration

    Swift

    public static let failedDependency = HTTPResponseStatus(code: 424)
  • 426 Upgrade Required

    Declaration

    Swift

    public static let upgradeRequired = HTTPResponseStatus(code: 426)
  • 428 Precondition Required

    Declaration

    Swift

    public static let preconditionRequired = HTTPResponseStatus(code: 428)
  • 429 Too Many Requests

    Declaration

    Swift

    public static let tooManyRequests = HTTPResponseStatus(code: 429)
  • 431 Request Header Fields Too Large

    Declaration

    Swift

    public static let requestHeaderFieldsTooLarge = HTTPResponseStatus(code: 431)
  • 451 Unavailable For Legal Reasons

    Declaration

    Swift

    public static let unavailableForLegalReasons = HTTPResponseStatus(code: 451)
  • 500 Internal Server Error

    Declaration

    Swift

    public static let internalServerError = HTTPResponseStatus(code: 500)
  • 501 Not Implemented

    Declaration

    Swift

    public static let notImplemented = HTTPResponseStatus(code: 501)
  • 502 Bad Gateway

    Declaration

    Swift

    public static let badGateway = HTTPResponseStatus(code: 502)
  • 503 Service Unavailable

    Declaration

    Swift

    public static let serviceUnavailable = HTTPResponseStatus(code: 503)
  • 504 Gateway Timeout

    Declaration

    Swift

    public static let gatewayTimeout = HTTPResponseStatus(code: 504)
  • 505 HTTP Version Not Supported

    Declaration

    Swift

    public static let httpVersionNotSupported = HTTPResponseStatus(code: 505)
  • 506 Variant Also Negotiates

    Declaration

    Swift

    public static let variantAlsoNegotiates = HTTPResponseStatus(code: 506)
  • 507 Insufficient Storage

    Declaration

    Swift

    public static let insufficientStorage = HTTPResponseStatus(code: 507)
  • 508 Loop Detected

    Declaration

    Swift

    public static let loopDetected = HTTPResponseStatus(code: 508)
  • 510 Not Extended

    Declaration

    Swift

    public static let notExtended = HTTPResponseStatus(code: 510)
  • 511 Network Authentication Required

    Declaration

    Swift

    public static let networkAuthenticationRequired = HTTPResponseStatus(code: 511)
    • The Class representing the class of status code for this response status

    Declaration

    Swift

    public var `class`: Class
  • Declaration

    Swift

    public enum Class