What is API And What is Rest And Soap API

Posted By : Himanshu Shukla | 22-May-2018

API: API stands for "Application programming interface" and we say that API is a set of rules in which we describe how one application interact with other application.
how to interact two application? like one application would like to access data of other application.first application sends the request to other application and other application return response against the request.
API provides software to software interaction and it's not provided a user interface.

 

web services API: it is an API and its a piece of software and its provide service to access on world wide web. and web services used HTTP to exchange information from one place to another palace. When one application, the “client”, wants to communicate with the web service, the application sends an HTTP request. The web service then sends an HTTP response

Types of web services API:
1.Rest API
2.SOAP
3.XML- RPC
4.JSON- RPC

 

Rest API: It's a lightweight, highly scalable and it is used to create API for web-based applications. It is used for HTTP protocol as a medium of communication b/w server and client. Rest API stands for "Representational state transfer".

Client --HTTP Request-------->Server

Server--Response HTTP-------->Client

This type of Messages having in the form of message data and Metadata its information about the message.

Main Components of Rest API:

1.HTTP Request:

Verb +URI +HTTP Version.
                  Verb: It's having different types of HTTP request like Get, Post, Delete, Put etc.

                      URI: Uniform resource identifier(URI) to identify the resource on the server

HTTP Version: It displays the version of HTTP. For Ex-HTTP V 1.1

Request Header: It's having MetaData for the HTTP Request message in the form of the key-value pair.


Request Body: In this message content or resource representation.


2.HTTP Response:

                                                                   Status/Response Code + HTTP version
Status/Response code displays the server status for the requested resource. For Ex-404, its means resource not found and 200 status means response is OK.

Response Header: It's having metadata for HTTP response message in the form of key-value pairs.For Ex-content length,content type, response data,server type etc.


Response Body: Its have Response message content or Resource Representation.


SOAP: SOAP stands for "Simple object access protocol" and it's also a communication medium to one application to other application and its used XML format for communication. In soap, XML is used for sending requests and receive responses so it's become extremely complex. In some programming languages, you need to build those requests manually, when you working with Microsoft .NET language you never even see the XML language.

Thanks!!

Related Tags

About Author

Author Image
Himanshu Shukla

Himanshu has good ability to solve the issues and provide the appropriate solution.

Request for Proposal

Name is required

Comment is required

Sending message..