Skip to content

Instantly share code, notes, and snippets.

View aainaj's full-sized avatar

Aaina Jain aainaj

  • GoJek Tech
  • Bangalore, India
View GitHub Profile
@ollieatkinson
ollieatkinson / HTTPStatusCode.swift
Last active November 15, 2024 14:04
HTTP status codes as a Swift enum.
/// This is a list of Hypertext Transfer Protocol (HTTP) response status codes.
/// It includes codes from IETF internet standards, other IETF RFCs, other specifications, and some additional commonly used codes.
/// The first digit of the status code specifies one of five classes of response; an HTTP client must recognise these five classes at a minimum.
enum HTTPStatusCode: Int, Error {
/// The response class representation of status codes, these get grouped by their first digit.
enum ResponseType {
/// - informational: This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line.
case informational