URL-Form-Encoded Request AFNetworking

时间:2015-05-11 14:04:20

标签: ios objective-c iphone afnetworking nsurlrequest

来自AFNetworking的表单编码请求我想通过字典传递参数,但我在数组中有值 (     2,     6,     9,     12,     15 )

此数组长度可以更改,但我想传递@“tags []”:@“”(这里我想填充数组)

 AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];


NSDictionary *parameters = @{@"user_id" : userId ,
                             @"token" :  userToken ,
                             @"tags[]" : @"9" ,

                            @"tags[]" : @"2" ,

                             @"tags[]" : @"5" ,

                             @"tags[]" : @"16"

                             };



[manager POST:@"http:example.com" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {

    NSLog(@"JSON: %@", responseObject);
  

块引用

1 个答案:

答案 0 :(得分:0)

怎么样:

NSDictionary *parameters = @{@"user_id" : userId,
                               @"token" : userToken,
                                @"tags" : tagsArray};