Soap API:
Soap is protocol base, follows only protocol HTTP
Supports only one format which XML
Soap consumes more bandwidth
Soap cannot be rest
Rest API:
Rest is architectural style and follow multiple protocols (HTTP, HTTPS, FTP etc.)
Supports more than one format like XML and Jason.
Rest consumes less bandwidth and it is much faster than soup.
Rest can be soup
Rest API Components:
Base URL: Contains the root/path of API
End Point: indicates specific point like login etc.
Body: use to send parameters to servers
Headers: Additional parameters are sent from here i.e. device, brewers etc.
Methods: (to perform activity/action to achieve task)
Get: to retrieve data from the sever
Put: use to update complete data
Post: use to create new record/entity.
Patch: use to update specific field/information.
Status Codes:
200: OK
201: Created
202: Accepted
300: Multiple Choices
301: Moved Permanently
307: Temporary Redirect
308: Permanent Redirect
400: Bad Request
401: Unauthorized
402: Payment Required
403: Forbidden (Permission)
404: not Found
405: Method Not Allowed
500: Internal Server Error
501: Not Implemented
502: Bad Gateway
503: Service Unavailable
504: Gateway Timeout
Status Series:
200: Success
300: Redirections
400: Client Error
500: Server Error