Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void)registerDevice{
- // get mac address
- NSString *macAddress = [self getMacAddress];
- NSLog(@"MAC ADDRESS RETURNED: %@", macAddress);
- NSString *command= @"BookAbort";
- NSString *format=@"JSON";
- //[SVProgressHUD showInView:self.view];
- // prepare MAC address
- // NSString *processedMACAddress = [macAddress
- // stringByReplacingOccurrencesOfString:@":" withString:@""];
- macAddress = @"1234";
- NSString * url = [NSString stringWithFormat:@"registerDevice/%@.htm", macAddress];
- NSLog(@"Connecting URL : %@", url);
- NSArray *keys = [[[NSArray alloc] initWithObjects:@"deciveID",nil] autorelease];
- NSArray *values = [[[NSArray alloc] initWithObjects:@"1234",nil] autorelease];
- NSDictionary *requestParameters = [[[NSDictionary alloc] initWithObjects:values forKeys:keys] autorelease];
- [[FMBHTTPClient sharedClient] postPath:url parameters:requestParameters success:^(id object) {
- [SVProgressHUD dismiss];
- NSLog(@"Server response Book abort%@ ", object);
- } failure:^(NSHTTPURLResponse *response, NSError *error) {
- [SVProgressHUD dismissWithError:[error localizedDescription]];
- NSLog(@"Error : %@", error);
- }];
- }
- 2012-09-24 17:50:36.669 FMB[7538:207] Error :Error Domain=com.alamofire.networking.error Code=-1011 "Expected status code <NSIndexSet: 0x6826a40>[number of indexes: 100 (in 1 ranges), indexes: (200-299)], got 405" UserInfo=0x6a43410 {NSErrorFailingURLKey=<URL PATH>, NSLocalizedDescription=Expected status code <NSIndexSet: 0x6826a40>[number of indexes: 100 (in 1 ranges), indexes: (200-299)], got 405}
Add Comment
Please, Sign In to add comment