Webservice
It is communicating between different platforms, different operating systems or different devices by using World Wide Web.e.g. mobile and web. Suppose the user has registered on Facebook or Gmail on the website. Now he wants to use a mobile app. So it is not required to register again as we have already registered. We can use the same details for login on mobile as well as the website. It can be possible by using web services. App sends a request to a server and gets a response in JSON or XML format from server.
API - application program interface
There are two types of web services:
1.SOAP
2.REST
SOAP - Simple Object Access Protocol
It gets a response in XML format. It is platform independent and language independent. By using SOAP, you will be able to interact with other programming language applications.
REST - Representational State Transfer
REST is an architecture for client-server communication. It sends an HTTP request to server and server send a response in JSON format. JSON means Javascript Object Notation. It is an object with key-value pair. e.g. {name: "Abc", mobile: '9876543210', email: "abc@gmail.com"}
Methods involve in REST API are
- POST
- GET
- PUT
- DELETE
- PATCH
POST is used to create a resource e.g. register a user
GET is used to retrieve a resource When we need details of a particular user. Here we need to send userid or mobile no through URL. So we can fetch data using that id or mobile.
PUT is used to update or create a resource. If the user is already registered then updates his record otherwise create a new record.
DELETE is used to delete a resource.
PATCH is used to update a resource partially. When we need to update the user's status only
very interesting , good job and thanks for sharing such a good blog.
ReplyDeleteplease Visit-
Web Development company
hire android app developer
hire .net developer