POST dizi yolla

0 Cevap php

i sunucuya benim iphone app dizi gibi bazı veri göndermek isteyen

I bir NSString olarak mesajı göndermeden önce ben tek değişkenlerin gönderme zaman

NSString *post =[[NSString alloc] initWithFormat:@"userName=%@&accountID=%@&",
                                                  username,accId];

NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding  allowLossyConversion:YES];

NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];

NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; 
[request setURL:url]; 
[request setHTTPMethod:@"POST"]; 
[request setValue:postLength forHTTPHeaderField:@"Content-Length"]; 
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; 
[request setHTTPBody:postData];

Şimdi ben nasıl i nasıl geri alabilirsiniz benim sunucu php ve sonra bir POST bir NSArray gönderirim, bu kullanıcı adı ve accountIds bir dizi göndermek ister misiniz?

Teşekkürler

0 Cevap