您好,我需要發送一個陣列中Afnetworking查詢字符串如何在Afnetwoking post方法中將數組作爲參數發送?
AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:@"http://192.008.0.28/aaa/a/"]];
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys: @"20", @"Miles", [NSArray arrayWithObjects:@"1",@"2",@"3",nil], @"Interval", nil];
[httpClient postPath:iUpdateNotificationMethod parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSString *responseStr = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
NSLog(@"Request Successful, response '%@'", responseStr);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"[HTTPClient Error]: %@", error.localizedDescription);
}];
但是服務器端,我們得到了「萬里行」的參數的一個:20,「間隔」:空如何解決它 謝謝,
這是你想要的? http://stackoverflow.com/questions/11088025/afnetworking-how-to-specify-multiple-values-for-one-key – Luke