What is the difference between a Web service and getting post/get return data?

Source: Internet
Author: User
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?


Reply to discussion (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

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.

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.

Thank you, moderator teacher.
In fact, the difference between RESTful APIs and Web service is still not clear. Is rest not a design pattern? So what is the specific way to implement it? Post/get?

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.