1. App Interface (communication interface)
- Interface Address: For example: http://app.com/api.php
- Interface files: api.php processing some business logic (get Data)
- Interface data: Get data, upload to client for use
the core of the app interface is the interface file
2. How the App interface communicates The client sends an HTTP request to the server (an interface address that is not visible to the user), and the server receives the HTTP request and processes it according to the request, returning the data to the client after processing ends (the data is typically in XML and JSON two formats). 3. XML data and JSON data
XML--extensible Markup LanguageExtended Markup Language
Used to tag language data and define data types, which is a source language that allows users to define their own markup language. The nodes of the XML language can be customized, and the nodes (tags) of the HTML language cannot be customized, such as:<p>,
<? xml version = "1.0" encoding = "UTF-8"?> <item> <title>singwa</title> <test id = "1"/> </item>
The XML language must and can only have one root node <item>
JSON-to- JavaScript Object Notation
A lightweight data interchange format that has good readability and is easy to write quickly. Use highly compatible text formats that are completely language-independent.
- The difference between XML and JSON
| Readability |
XML data is more readable (structurally clear) |
| Generate Data aspects (PHP generates XML and JSON) |
JSON uses only one function to facilitate |
| Transmission speed |
Small JSON data, fast transfer speed |
4. App interface function
gets data from the database or cache, and then returns it to the client through the interface data
data is submitted to the server via an interface, and then the server is processed or otherwise processed. The interface for submitting data consists of two versions: Version upgrade interface and data receiving interface
Introduction to the App interface