問題描述
Ghi giá trị bài đăng trong ASIFormDataRequest (Log Post Value in ASIFormDataRequest)
I have setPostValue in ASIFormDataRequest. like so:
ASIFormDataRequest *request = [[ASIFormDataRequest alloc] initWithURL:[NSURL URLWithString:url]];
[request setPostValue:@"helmi" forKey:@"username"];
[request setPostValue:@"123" forKey:@"password"];
[request setPostValue:@"goods" forKey:@"purchase"];
NSLog(@"...");
I'd like to show the NSLog of Post Value before send to server. reasons is because I have many variable value in post value, need to check whether I put correctly.
參考解法
方法 1:
ASIFormDataRequest
holds a variable called postData which is an NSMutableArray
. You can access its value using
NSLog(@"%@", [request valueForKey@"postData"])