安卓端怎么定时向服务器端不断请求更新的数据

安卓端怎么定时向服务器端不断请求更新的数据,第1张

>用curl
$ch = curl_init();
$header[] = "Content-type: text/xml";//定义content-type为xml
curl_setopt($ch, CURLOPT_URL, $url); //定义表单提交地址
curl_setopt($ch, CURLOPT_POST, 1); //定义提交类型 1:POST ;0:GET
curl_setopt($ch, CURLOPT_HEADER, 1); //定义是否显示状态头 1:显示 ; 0:不显示
curl_setopt($ch, CURLOPT_>发送请求:
- (void)sendUpdateUserRequest
{
//添加等待
[MBProgressHUD showHUDWithText:@"正在更新,请稍候···"
toView:selfnavigationControllerview animated:YES];
NSMutableDictionary headDict=[[NSMutableDictionary alloc] init];
NSMutableDictionary dataDict=[[NSMutableDictionary alloc] init];
//组装数据只是一个例子,可以添加你想要的属性以及值
[headDict setObject:@"user" forKey:@"function"];
[dataDict setObject:_useridLabeltext forKey:@"userid"];
//要发送的数据


>

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zz/10404050.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-08
下一篇2023-05-08

发表评论

登录后才能评论

评论列表(0条)

    保存