后期数据中的数组Afnetworking提供错误 - 所需数据丢失

时间:2016-06-27 21:31:39

标签: ios iphone afnetworking afnetworking-2

我正在使用afnetworking从post数组数据发送到服务器端这里是我的代码...

 NSMutableDictionary *dict1=[[NSMutableDictionary alloc]initWithObjectsAndKeys:@"online_status",@"option_name",dict[@"option_value"],@"option_value", nil];
    NSArray *arr1=[[NSMutableArray alloc]initWithObjects:dict1, nil];

    NSMutableDictionary *dict2=[[NSMutableDictionary alloc]initWithObjectsAndKeys:[UserDefaults valueForKey:@"user_id"],@"user_id",arr1,@"option_array", nil];



    NSError *error = nil;
            NSString *createJSON = [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:dict2
                                                                                                  options:NSJSONWritingPrettyPrinted
                                                                                                    error:&error]
                                                         encoding:NSUTF8StringEncoding];

 NSDictionary *pardsams = @{@"data": createJSON};

    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];

    NSLog(@"Dict %@",pardsams[@"data"]);

    manager.responseSerializer.acceptableContentTypes = [manager.responseSerializer.acceptableContentTypes setByAddingObject:@"text/html"];

    [manager POST:[NSString stringWithFormat:@"%@set_user_multiple_options",K_APP_URL] parameters:        pardsams[@"data"] success:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSLog(@"JSON: %@", responseObject);

    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"Error: %@", error);

    }];

获得服务器响应是:

message = "Required parameters missing.";
status = 0;

我会点击休息客户端的请求但是在哪里得到正确的响应已保存的数据bt试图在代码中执行它不起作用polease ...帮助我

0 个答案:

没有答案