ASIFormDataRequest中的Log Post Value

时间:2013-03-13 02:13:33

标签: objective-c asihttprequest

我在ASIFormDataRequest中有setPostValue。像这样:

ASIFormDataRequest *request = [[ASIFormDataRequest alloc] initWithURL:[NSURL URLWithString:url]];

[request setPostValue:@"helmi" forKey:@"username"];
[request setPostValue:@"123" forKey:@"password"];
[request setPostValue:@"goods" forKey:@"purchase"];

NSLog(@"...");

我想在发送到服务器之前显示发布值的NSLog。原因是因为我在post值中有很多变量值,需要检查我是否正确放置。

1 个答案:

答案 0 :(得分:2)

ASIFormDataRequest包含一个名为postData的变量NSMutableArray。您可以使用

访问其值
NSLog(@"%@", [request valueForKey@"postData"])