Created
May 14, 2015 04:07
-
-
Save reza-ryte-club/6a1241b1457cbd906436 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.m | |
// logintest | |
// | |
// | |
#import "ViewController.h" | |
#import "AFNetworking.h" | |
@interface ViewController () | |
@end | |
@implementation ViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view, typically from a nib. | |
NSLog(@"Hello man"); | |
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; | |
[manager setRequestSerializer:[AFJSONRequestSerializer serializer]]; | |
[manager.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; | |
NSDictionary *parameters = @{@"name": @"bar"}; | |
[manager POST:@"https://damp-sands-2243.herokuapp.com/students" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
NSLog(@"JSON: %@", responseObject); | |
} failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
NSLog(@"Error: %@", error); | |
}]; | |
NSLog(@"Boo"); | |
} | |
- (void)didReceiveMemoryWarning { | |
[super didReceiveMemoryWarning]; | |
// Dispose of any resources that can be recreated. | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment