List of HTTP status codes as typedef enum. kHTTPStatusCodeOK, kHTTPStatusCodeNotFound, and so on.
C Objective-C Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
nv-ios-http-status.xcodeproj
nv-ios-http-status
.gitignore
LICENSE
README.md
nv-ios-http-status.podspec

README.md

nv-ios-http-status

Overview

This project provides a header file that lists HTTP status codes, mainly for iOS programming. A typedef enum, HTTPStatusCode, contains entries whose name start with kHTTPStatusCode such as kHTTPStatusCodeOK.

The initial version of the list of HTTP status codes (HTTPStatusCodes.h) was written based on the list at Wikipedia (List of HTTP status codes) on April 20, 2013.

Note that unofficial HTTP status codes are included and some of such variants can be excluded by defining HTTP_STATUS_CODES_EXLUCE_xxx.

License

Apache License, Version 2.0

Download

git clone https://github.com/TakahikoKawasaki/nv-ios-http-status.git

Example

#import "HTTPStatusCodes.h"

......

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
    NSHTTPURLResponse *res = (NSHTTPURLResponse *)response;

    switch ([res statusCode])
    {
        case kHTTPStatusCodeOK:
            ......;
    }

    ......
}

Author

Takahiko Kawasaki, Neo Visionaries Inc.