Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)welcome
- {
- /******************** Envoi de données POST au sereveur php et retourne un JSON ****************************/
- NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];
- NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
- udid,@"UDID",
- nil];
- AFHTTPClient *client = [[AFHTTPClient alloc] initWithBaseURL:
- [NSURL URLWithString:@"http://hive-concept.com/web/app_dev.php/initializeTable"]];
- [client setDefaultHeader:@"Accept" value:@"application/json"];
- [client setParameterEncoding:AFJSONParameterEncoding];
- [client postPath:@"" parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
- //responseObject
- NSString *text = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
- NSLog(@"Data Sent - Response: %@", text);
- //TO DO
- //NSLog(@"responseObject %@",[responseObject class]);
- //NSLog(@"lala %@", (NSDictionary *)responseObject);
- } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
- NSLog(@"error %@", [error localizedDescription]);
- }];
- /******************** Fin Envoie POST ****************************/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement