iphone sonrası isteği json veri almak için nasıl

0 Cevap php

Ben JSON çerçevesini kullanarak bir iPhone App geliştiriyorum, ben yerel sunucuda MySQL veritabanını güncellemek için bir PHP komut dosyası arıyorum. Bu kodu kullanarak:

NSString *jsonString = [sendData JSONRepresentation];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
NSString*post = [NSString stringWithFormat:@"&json=%@", jsonString];
NSData*postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:NO];

[request setURL:[NSURL URLWithString:@"http://localhost:8888/update.php"]];
[request setHTTPMethod:@"POST"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
[request setHTTPBody:postData];

Ben sormak istiyorum:

Ne bu isteği veri almak için PHP script ve nasıl veritabanına güncellemek için PHP nesnesine JSON veri çözümlenebilir?

Herhangi bir yardım mutluluk duyacağız.

0 Cevap