如何通过asihttprequest从ios应用程序向服务器发送短信?如果有人有示例代码,请帮助我。现在真的需要帮助
答案 0 :(得分:0)
您需要为此目的设置post变量。
formReq = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:urlString]];
formReq.delegate = self;
[formReq setPostValue:MESSAGE forKey:@"key"];
[formReq startSynchronous];
您需要实施两种委托方法
- (void)requestFinished:(ASIHTTPRequest *)request{
NSLog(@"requestFinished: %@", [request responseString]);
}
- (void)requestFailed:(ASIHTTPRequest *)request
{
NSError *error = [request error];
NSLog(@"oops: %@", [error localizedDescription]);
}