我正在尝试从我的 Iphone 客户端将数据发送到服务器。它适用于大多数值,但是当它尝试发送像“IPhone+Cocoa”这样的字符串时,服务器将字符串显示为“IPhone Cocoa”。我试图用谷歌搜索它,但没有成功,有什么理由这样做。
这是我的代码
-(void)sendRequest:(NSString *)aRequest
{
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:kURLRequest]];
NSString *httpBody = [NSString stringWithFormat:@"%@=%@",[requestString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],[aRequest stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSData *aData = [httpBody dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:aData];
[request setHTTPMethod:@"POST"];
self.feedURLConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
}
谁能帮我?