自己把问题解决了:
TTURLRequest的parameters中的数据设置的格式是发送文件的报文形式。
如果要用request.getParamter来解析。需要自己构造post的httpbody
这么写:
TTURLRequest *request = [self request:url Delegate:delegate];
[request setHttpMethod:@"POST"];
request.contentType=@"application/x-www-form-urlencoded";
NSMutableString* postBodyString = [NSMutableString stringWithString:@""];
if (nil != info) {
[request setUserInfo:[NSDictionary dictionaryWithDictionary:info]];
}
if (nil != params) {
for (NSString *key in [params allKeys]) {
NSString* p = [NSString stringWithFormat:@"%@=%@",key,[[params valueForKey:key] URLEncodedString]];
postBodyString = [NSString stringWithFormat:@"%@&%@",postBodyString,p];
}
}
NSData* postData = [NSData dataWithBytes:[postBodyString UTF8String] length:[postBodyString length]];
[request setHttpBody:postData];
[request send];