When I first arrived at a new company, the company's project was mainly for app, and the data on the app was mainly through calling the data interface on the web background, but I have never touched the interface before, the previous tasks were to write program code in the web background and then display it on the page. Now suddenly I am in touch with the interface...
When I first arrived at a new company, the company's project was mainly for app, and the data on the app was mainly through calling the data interface on the web background, but I have never touched the interface before, the previous tasks were to write program code in the web background and display it on the page. now, suddenly I still don't know how to contact the interface.
I would like to ask if the write interface must first implement the corresponding module functions in the web background. the person who writes an interface for the interface and then is responsible for APP development calls this interface directly, what about retrieving data from the database? [Is this the principle]
In comparison: I want to write an interface for updating announcements and security dynamics. Do I need to first develop the functions of these two modules in the web background and then write an interface for them? If so, write the interface based on what data or parameters are required. Format
Reply content:
When I first arrived at a new company, the company's project was mainly for app, and the data on the app was mainly through calling the data interface on the web background, but I have never touched the interface before, the previous tasks were to write program code in the web background and display it on the page. now, suddenly I still don't know how to contact the interface.
I would like to ask if the write interface must first implement the corresponding module functions in the web background. the person who writes an interface for the interface and then is responsible for APP development calls this interface directly, what about retrieving data from the database? [Is this the principle]
In comparison: I want to write an interface for updating announcements and security dynamics. Do I need to first develop the functions of these two modules in the web background and then write an interface for them? If so, write the interface based on what data or parameters are required. Format
Thank you for your invitation. You can use an excuse as a common webpage request or a form request on a webpage, the difference is that the data on the webpage needs to be queried and then rendered to the view file and displayed to the user through a browser. Interfaces query, insert, update, and delete based on different conditions. Then the final result isJson
Orxml
Return the formatted data to the client.
There should be an interface document for calling an interface, which has the following points:
Interface address
Interface parameters
Status code and data format returned by the API
Go directly to the code!
First, call the interface:
Then the interface code:
This is the data that one project in our project calls in another project. this is what I originally wrote (there should be some unreasonable points, such as the IP address of the verification request. If the interface data is successfully retrieved or fails, a status code is returned.status
. I usually return json format, and the front-end and back-end calls can also be parsed.
(Why do we need to pass the name instead of the ID, because the two project data tables have the same user name but different IDs? Hello !~ Do not care too much about details)