1

こんにちは、Afnetworking クエリ文字列のパラメーターの 1 つとして配列を送信する必要があります

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);
    }];

しかし、サーバー側では "Miles":20,"Intervals":null を取得しました 修正方法 ありがとう、

4

3 に答える 3