Skip to content

Commit

Permalink
Extend StatusCodeFormatter
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Jul 6, 2023
1 parent 3dd40ab commit e94e1f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ enum HTTPMethod: String, Hashable, Codable, CaseIterable, CustomStringConvertibl
case head = "HEAD"
case post = "POST"
case put = "PUT"
case patch = "PATCH"
case delete = "DELETE"
case connect = "CONNECT"
case options = "OPTIONS"
Expand Down
3 changes: 3 additions & 0 deletions Sources/PulseUI/Helpers/Formatters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ enum StatusCodeFormatter {
switch statusCode {
case 0: return "Success"
case 200: return "200 OK"
case 418: return "418 Teapot"
case 429: return "429 Too many requests"
case 451: return "451 Unavailable for Legal Reasons"
default: return "\(statusCode) \( HTTPURLResponse.localizedString(forStatusCode: statusCode).capitalized)"
}
}
Expand Down

0 comments on commit e94e1f0

Please sign in to comment.