Objective-C REST API Network Status Codes
/*!@typedef NS_ENUM (NSUInteger, kStatusInformation)@abstract Informational responses.@discussionThese are valid only in the scope of <Project Name>.*/typedef NS_ENUM(NSInteger, kStatusInformation) {/*!This interim response indicates that everything so far is OKand that the client should continue with the request or ignoreit if it is already finished.*/kStatusInformation_Continue = 100,/*!This code is sent in response to an Upgrade: request header bythe client, and indicates that the protocol the server is switching too.It was introduced to allow migration to an incompatible protocol version,and is not in common use.*/kStatusInformation_SwitchingProtocol = 101,};/*!@typedef NS_ENUM (NSUInteger, kStatusSuccess)@abstract Successful responses.@discussionThese are valid only in the scope of Momentage.*/typedef NS_ENUM(NSInteger, kStatusSuccess) {/*! The request has succeeded. */kStatusSuccess_OK = 200,/*!The request has succeeded and a new resource has beencreated as a result of it.This is typically the response sent after a PUT request.*/kStatusSuccess_Created = 201,/*!The request has been received but not yet acted upon.It is non-committal, meaning that there is no way in HTTP to later sendan asynchronous response indicating the outcome of processing the request.It is intended for cases where another process or server handles the request,or for batch processing.*/kStatusSuccess_Accepted = 202,/*!This response code means returned meta-information set is not exactset as available from the origin server, but collected from a localor a third party copy. Except this condition, 200 OK response shouldbe preferred instead of this response.*/kStatusSuccess_PartialInfo = 203,/*!There is no content to send for this request, but the headers may beuseful. The user-agent may update its cached headers for thisresource with the new ones.*/kStatusSuccess_NoResponse = 204,/*!This response code is sent after accomplishing request to tell useragent reset document view which sent this request.*/kStatusSuccess_RestContent = 205,/*!This response code is used because of range header sent by the clientto separate download into multiple streams.*/kStatusSuccess_PartialContent = 206,/*! */kStatusSuccess_251 = 251,};/*! *//*!@typedef NS_ENUM (NSUInteger, FBErrorCode)@abstract Error codes returned by the Facebook SDK in NSError.@discussionThese are valid only in the scope of FacebookSDKDomain.*/typedef NS_ENUM(NSInteger, APIErrorCode) {APIErrorCodeMultipleChoice = 300};// 4xx Client error/*!@typedef NS_ENUM (NSUInteger, kStatusClientError)@abstract Client error responses@discussionThese are valid only in the scope of Momentage.*/typedef NS_ENUM(NSInteger, kStatusClientError) {/*! */kStatusClientError_BadRequest = 400,/*! */kStatusClientError_Unauthorized = 401,/*! */kStatusClientError_PaymentRequest = 402,/*! */kStatusClientError_Forbidden = 403,/*! */kStatusClientError_NotFound = 404,/*! */kStatusClientError_MethodNotAllowed = 405,kStatusClientError_ExpectationFailed = 417,};// 5xx Server error responses/*!@typedef NS_ENUM (NSUInteger, kStatusServerError)@abstract Client error responses@discussionThese are valid only in the scope of Momentage.*/typedef NS_ENUM(NSInteger, kStatusServerError) {/*! The server has encountered a situation it doesn't know how to handle. */kStatusServerError_InternalError = 500,/*!The request method is not supported by the server and cannot be handled. The onlymethods that servers are required to support (and therefore that must not returnthis code) are GET and HEAD.*/kStatusServerError_NotImplemented = 501,/*!This error response means that the server, while working as a gateway to get aresponse needed to handle the request, got an invalid response.*/kStatusServerError_BadGateway = 502,/*!The server is not ready to handle the request. Common causes are a server that isdown for maintenance or that is overloaded. Note that together with this response,a user-friendly page explaining the problem should be sent. This responses shouldbe used for temporary conditions and the Retry-After: HTTP header should, ifpossible, contain the estimated time before the recovery of the service. Thewebmaster must also take care about the caching-related headers that are sentalong with this response, as these temporary condition responses should usuallynot be cached.*/kStatusServerError_ServiceUnavailable = 503,/*!This error response is given when the server is acting as a gateway and cannot geta response in time.*/kStatusServerError_GatewayTimeout = 504,/*! The HTTP version used in the request is not supported by the server. */kStatusServerError_HTTPVersionNotSupported = 505,};
via -
Github Gist
Other Links -