Skip to content

Instantly share code, notes, and snippets.

@khanlou khanlou/HTTPMethod.h
Last active Aug 22, 2018

What would you like to do?
@interface HTTPMethod: NSString
+ (HTTPMethod *)GET;
+ (HTTPMethod *)POST;
@interface HTTPMethod()
@property NSString *name;
@implementation HTTPMethod
+ (HTTPMethod *)GET {
return [[HTTPMethod alloc] initWithName:@"GET"];
+ (HTTPMethod *)POST {
return [[HTTPMethod alloc] initWithName:@"POST"];
- (instancetype)initWithName:(NSString *)name {
self = [super init];
if (!self) return nil;
_name = name;
return self;
- (NSUInteger)length {
- (unichar)characterAtIndex:(NSUInteger)index {
return [ characterAtIndex:index];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.