With the difficulty of this and the lack of examples or suggestions on doing this on the web, it feels like I’m going about this all wrong.
What is the “normal” and “modern” way to send data and receive data from a client to a server over the 'net? I can’t seem to find any real info on that, so maybe I’m using the wrong keywords or something? I gotta think there’s tons of apps that want to store and retrieve info on a server - I mean it’s what databases are all about, right?
php IS a server app. A multithreaded one, much more robust and feature complete than any Xojo app.
Xojo maybe is good at RAD, but sucks at performance and multithreading. For non GUI apps like in this case, php is a way better option than Xojo.
if you want to use just the URL and your strings are short enough, you can encode the text to Base64.
BUT it is a lot better to use plain JSON with POST. Also, add a key in the JSON to work as a key, some value that you can verify on the server to ensure only you can send data (could be a simple hash of your salted data)
Ok. Good to know. I was just surprised how little info there is on how to do this, thinking maybe people had moved to another method.
Another Dumb question: Does REST have anything to do with this? I keep seeing that word these days. I also see SOAP. I thought I had read that SOAP was an older protocol and no longer used?
I don’t know about “modern”, but I’m pretty sure it’s what most people do most often. Pulling down something by downloading a URL with a socket is trivial, as Beatrix mentioned; maybe that’s why you don’t see it mentioned much. Last time I needed to upload I gave up on FTP (can’t remember why) and went with MBS plugins’ CURL setup, which has worked perfectly for me.
You will need to look into the best practices for data sanitation. You always need to sanitize input from the internet, you never know who’s doing what trying to get in to your server.
I’m trying to say I don’t know PHP well enough (Xojo code is my day job, and nobody is contracting me to research PHP right now) to know if the bit I shared is safe from injection attacks or similar. Think like the reason we need PreparedStatements.