What is the difference between a Web service and getting post/get return data?
What is the difference between directly returning data and Web service by getting the value of Post/get? What are the pros and cons?
Suppose to make a simple API:
Get commits the UserID and type, obtains both values after determining whether the UserID exists in the database, and returns the data based on the type if it exists.
How does this API work better in either of these two ways?
------Solution--------------------
From the point of view of data acquisition: all the same
Are services that provide data
The difference is that a WEB service provides a public data service that contracts incoming outgoing data formats and methods through WSDL
Post/get provides private services, and the data format has your private agreement
------Solution--------------------
Add
If you are developing APIs for your own website, I suggest you use REST. Of course the use of the station is also REST
This makes it possible to expose the REST string when you need it, without having to develop the API separately.