我需要将一些 post 参数传递给服务器,但 php 得到一个空数组 $_POST 这是我的代码:
NSString* user=UserNameField.stringValue;
NSString* pass=PasswordField.stringValue;
NSString* ID=IDField.stringValue;
NSURL *url = [NSURL URLWithString:ENTERANCE];
url = [NSURL URLWithString:@"http://sphere-beauty.com/test.php"];
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];
NSString* post=[NSString stringWithFormat:@"uname=%@&passwd=%@&id=%@",user,pass,ID];
[req setHTTPMethod:@"POST"];
[req setHTTPBody: [post dataUsingEncoding:NSUTF8StringEncoding]];
[[browser mainFrame] loadRequest:req];
谁能帮忙?