Quantcast
Channel: Answers by "Soviut"
Viewing all articles
Browse latest Browse all 23

Answer by Soviut

$
0
0
Serialize your data to either JSON or XML and then transfer that in a single "data" field in your POST request to the server. Once you receive this payload on the server, you can either deserialize the data into database fields, or simply store the entire data object in a single text field. In both cases, you should maintain a unique ID as well as a datetime field for when the record was created. Then, to fetch saved games, expose a URL on the server that takes an ID and return the saved data. Remember to set the correct MIME content type for JSON (application/json) or XML (application/xml) so that PHP and Apache don't try to inject any additional data into the header or body of the response. For more complex interoperability with a server (user authentication, fetching data from several different tables, etc.) you should consider reading up on how to build REST APIs. These are the type of web services Twitter and Google use to allow 3rd parties access to their data.

Viewing all articles
Browse latest Browse all 23

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>