Skip to content

Instantly share code, notes, and snippets.

@khanlou
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khanlou/2d7ba99e99c2e7f6933c to your computer and use it in GitHub Desktop.
Save khanlou/2d7ba99e99c2e7f6933c to your computer and use it in GitHub Desktop.
SKLoginRequest
@implementation SKLoginRequest
- (instancetype)initWithUsername:(NSString *)username password:(NSString *)password {
self = [super init];
if (!self) return nil;
_username = username;
_password = password;
return self;
}
- (NSString *)method {
return @"POST";
}
- (NSURL *)baseURL {
return [NSURL URLWithString:@"https://api.khanlou.com"];
}
- (NSString *)path {
return @"/users/login";
}
- (NSDictionary *)parameters {
return @{
@"username": self.username,
@"password": self.password,
}
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment