The Rest API demonstrates the most common widely used services existing today to integrate cross platform applications in order to communicate or share the data intuitively.
What is Web Service? |
---|
Web Services work on client-server model where client applications can access web services over the network. Web services provide endpoint URLs and expose methods that can be accessed over network through client programs written in java, shell script or any other different technologies. Web services are stateless and doesn’t maintain user session like web applications. Web services, a very well known term when we talk about exchanging some sort of data between multiple applications or say software. Based on the client-server model, these services can be used by multiple software application written in various languages and also it has an advantage of running on various platforms. |
What is your understanding of what are RESTful web services? |
---|
Just like SOAP (Simple Object Access Protocol), which is used to develop web services by XML method, RESTful web services use web protocol i.e. HTTP protocol method. They have the feature like scalability, maintainability, help multiple application communication built on various programming languages etc. RESTful web service implementation defines the method of accessing various resources which are required by the client and he has sent the request to the server through the web browser. The important aspects of this implementation include:
|
Name the protocol which is used by RESTful web services. |
---|
RESTful web services use a famous web protocol i.e. HTTP protocol. This serves as a medium of data communication between client and server. HTTP standard methods are used to access resources in RESTful web service architecture. |
Explain the term ‘Addressing’ with respect to RESTful WEB service. |
---|
Just like we require address with postal code to reach any person, in the same way, ‘Addressing’ locates resources that are present on the server for the purpose of hosting web services. This is usually done with URI i.e. Unified Resource Identifier. |
Enlist features of RESTful web services. |
---|
Every RESTful web services should have following features and characteristics that are enlisted below:
|
Explain messaging technique. |
---|
Messages are the mode of exchanging data for any type of communication to take place. In the same way, HTTP protocol plays the role of message communication between the client and server through HTTP Request and Response methods. HTTP request is sent by the client who contains information about the data and in turn, receives HTTP Response from the server. Messages are the collection of information about the data i.e. Metadata. |
What are the core components of HTTP request and HTTP response? |
---|
The core components that come under HTTP Request are:
The core components that come under HTTP Response are:
|
Explain the term ‘Statelessness’ with respect to RESTful WEB service. |
---|
In REST, ST itself defines State Transfer and Statelessness means complete isolation. This means, the state of the client’s application is never stored on the server and is passed on. In this process, the clients send all the information that is required for the server to fulfill the HTTP request that has been sent. Thus every client request and the response is independent of the other with complete assurance of providing required information. Every client passes a ‘session identifier’ which also acts as an identifier for each session. |
Enlist advantages and disadvantages of ‘Statelessness’. |
---|
Advantages:
Disadvantages:
|
Enlist some important constraints for RESTful web services. |
---|
Every constraint has positive as well as negative impacts and to produce an overall architecture, there should be the balance between both of them. Below mentioned are some important constraints for RESTful web service:
|
What is a ‘Resource’? |
---|
Just like the ‘Object’ instance, we have learned in object orient programming Language, in the same way, ‘Resource’ is defined as an object of a type which can be an image, HTML file, text data, and any type of dynamic data. There are varieties of representation formats available in order to represent a resource. Some most common are enlisted below:
|
Why proper representation of Resource is required? |
---|
Representation is very important because it determines the easy identification of resources. With proper representations of resource in the proper format, allows the client to easily understand the format. |
Enlist some important points that should be kept in mind while designing Resources representation for RESTful web services. |
---|
As there are no restrictions on the format in which the resource representation is done but just that the main requirement is the format of the representation should be as per the client requirement. A good resource representation is designed by considering the following main points:
|
What is Caching? |
---|
Caching is the process in which server response is stored so that a cached copy can be used when required and there is no need of generating the same response again. This process not only reduces the server load but in turn increase the scalability and performance of the server. Only the client is able to cache the response and that too for a limited period of time. Mentioned below are the header of the resources and their brief description so that they can be identified for the caching process:
|
Explain Cache-control header. |
---|
A standard Cache control header can help in attaining cache ability. Enlisted below is the brief description of various cache control header:
|
What are the best practices that are to be followed while designing RESTful web services? |
---|
To design a secure RESTful web service, there are some best practices or say points that should be considered. These are explained as follows:
|
What is Payload? |
---|
The request data which is present in the body part of every HTTP message is referred as ‘Payload’. In Restful web service, the payload can only be passed to the recipient through POST method. There is no limit of sending data as payload through POST method but the only concern is that more data with consuming more time and bandwidth. This may consume much of user’s time also. |
Enlist some of the HTTP methods with description. |
---|
Mentioned below is the list of HTTP methods with their descriptions:
|
What is the difference between PUT method and POST method? |
---|
The major difference between the PUT and POST method is that the result generated with PUT method is always same no matter how many times the operation is performed. On the other hand, the result generated by POST operation is always different every time. |
What is your understanding about JAX-RS? |
---|
JAX-RS is defined as the Java API for RESTful web service. Among multiple libraries and framework, this is considered as the most suitable Java programming language based API which supports RESTful web service. Some of the implementations of JAX-RS are:
Among these, Jersey is the most popular framework. |
What are HTTP status codes? Enlist few with meaning. |
---|
HTTP status codes basically are the representation of the status of the task that has been performed on the server, with the mode of some codes. Every code has their own meaning. Some of the HTTP status codes with their meaning are as follows:
|