StatusCode
public enum StatusCode : Int
HTTP status codes.
Note
Only those likely to be used by Algolia’s servers and SDK are listed here.-
Success.
Declaration
Swift
case ok = 200 -
Invalid parameters.
Declaration
Swift
case badRequest = 400 -
Invalid authentication.
Declaration
Swift
case unauthorized = 401 -
Operation unauthorized with the provided credentials.
Declaration
Swift
case forbidden = 403 -
The targeted resource does not exist.
Declaration
Swift
case notFound = 404 -
The HTTP method used in the request is not supported for the targeted endpoint.
Note
Should never occur when using this library.Declaration
Swift
case methodNotAllowed = 405 -
The server has encountered a fatal internal error.
Declaration
Swift
case internalServerError = 500 -
The server is temporarily down.
Declaration
Swift
case serviceUnavailable = 503
-
Test whether a status code represents success.
Declaration
Swift
public static func isSuccess(_ statusCode: Int) -> Bool -
Test whether a status code represents a client error.
Declaration
Swift
public static func isClientError(_ statusCode: Int) -> Bool -
Test whether a status code represents a server error.
Declaration
Swift
public static func isServerError(_ statusCode: Int) -> Bool
StatusCode Enumeration Reference