<分区>
Possible Duplicate:
POST in Objective-C iPad dev
我在网络等方面非常缺乏经验,所以请客气。
我正在尝试发送带有以下表单数据的发布请求
{"email":"JoeSmith@aol.com","password":"password","password_confirm":"password","name":"Joe Smith","cellphone":"4402415585 ","address":"假街"}:
到目前为止,这是我所拥有的:
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",SERVER_ADDRESS]] cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
timeoutInterval:10];
[request setHTTPMethod: @"POST"];
NSURLConnection *connection = [NSURLConnection connectionWithRequest:request delegate:self];
[connection start];
我的问题是我不知道如何在此请求中包含表单数据。我确定有一个简单的 NSMutableURLRequest
方法可以使用,但我还没弄清楚是哪一个。