开发者

syncing data with server

开发者 https://www.devze.com 2022-12-12 22:45 出处:网络
I\'m trying to sync data from my application onto the server. I\'m very new to this kind of work. For this i wrote a small web service in php,

I'm trying to sync data from my application onto the server. I'm very new to this kind of work. For this i wrote a small web service in php,

Now, i开发者_JAVA百科'm not able to figure out how to call this web service and how to send the 2 variable values to the insertData function from the app using xCode.

Any kind of help on this would be appreciated.

Thanks & Regards, NR


I would not sync data via php or http in general if i don't have to. I'd use simple things like scp, rsync or, if the data relates to my application some version control, such as git.

However, doing this via php could look something like this:

<!-- server side, lets say the url is http://example.org/sync.php -->
<?php 
    insert_stuff($_GET["username"], $_GET["password"]); 
    echo "Inserted.\n";
?>

Locally, i'd use curl:

$ curl "http://example.org/sync.php?username=root&password=root"
Inserted.

...

0

精彩评论

暂无评论...
验证码 换一张
取 消