gpt4 book ai didi

iphone - 使用 iOS 中的 post 方法通过 php Web 服务调用将注册 View Controller 文本值保存在服务器上

转载 作者:行者123 更新时间:2023-11-29 03:43:45 25 4
gpt4 key购买 nike

我有注册表单,其中包含名字、姓氏、性别、电子邮件、密码、用户图像、年龄等字段。我想通过 php webservice 调用将此用户信息保存在服务器上。如何将这些参数传递给服务 url?我将使用 post 方法使用 http 请求将用户信息保存到服务器,当该用户想要登录 iOS 应用程序时,我可能会匹配该用户的凭据。在岸上,我需要一个 iOS 应用程序的登录和注册屏幕,请向我推荐任何教程

提前感谢大家

最佳答案

首先需要创建php脚本,然后通过NSURL传输数据。

NSURL * url=[NSURL URLWithString:[NSString stringWithFormat:@"http://192.168.0.6/savedevicedata.php?Udid=%@&Flag=%d&DateTime=%@",uniqueIdentifier,Flag,FinalDate]];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSLog(@"%@",request);
[request setHTTPMethod:@"POST"];
//[request setHTTPBody:[NSString stringWithFormat:@"%@",rawStr]];

NSURLResponse *response;
NSError *err;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
NSLog(@"responseData: %@", responseData);

尝试此代码只是替换您的字段。

关于iphone - 使用 iOS 中的 post 方法通过 php Web 服务调用将注册 View Controller 文本值保存在服务器上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17995439/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com