REST is an API architecture style. REST API stands for REpresentational state Transfer Application Programming interface. REST API is also known as a RESTfulAPI or RESTful webservices. REST specifies how data is presented to a client in a format that is convenient for the client. It’s an API that uses HTTP requests such as GET, PUT, POST, and DELETE methods on data. REST defines 6 architectural constraints which make any web service – a true RESTful API. The HTTP method. Differing HTTP methods can be used on any endpoint which map to application create, read, update, and delete (CRUD) operations: The Relativity REST API requires a minimal number of standard fields in the HTTP header for a request. For more information about how headers are used, see Supported HTTP methods. CSRF – The cross-site request forgery (CSRF) field must be included in requests and set to blank (empty string). This field provides basic security by preventing malicious parties from scanning your REST endpoint. See the following example: X-CSRF-Header: [EMPTY OR BLANK VALUE] If you omit this header field, the request fails. Content-Type – This header field can be set to application/json, application/json;charset/utf-8, or text/json. See the following sample: Content-Type: application/json Authorization – This header field is required if you are using basic or Active Directory authentication. JAX-RS stands for Java API for RESTful web services. It is a set of Java APIs for building web services conforming to the REST Related. It is also support Bean validation. Typically, it is used for XML or JSON data exchange. Some of JAS-RS frameworks are : Jersey,RESTlet,Apache CXF,RESTEasy,play.etc. URI stand s for Uniform Resource Identifier. It is the identifier for the resource in REST Architecture. In the above question, we have understood the meaning of statelessness with respect to the client-server communication. Now, let us see some of its advantages and disadvantages. Pros: Every method required for communication is identified as an independent method i.e. there are no dependencies to other methods. Any previous communication with the client and server is not maintained and thus the whole process is very much simplified. If any information or metadata used earlier in required in another method, then the client sends again that information with HTTP request. HTTP protocol and REST web service, both shares the feature of statelessness. Cons: In every HTTP request from the client, the availability of some information regarding the client state is required by the web service. There are many testing tools available for web services. Some of the Webservices testing tools are: It is used o for all the operations of a web service supports. It creates read only requests to the server Some of the HTTP status codes and Meaning In RESTful Web Service, Request body of every HTTP message includes request data called as payload.it is part of the message is of interest to the recipient. These methods are defined to be safe; this means to not alter the state in the server HATEOAS stand for Hypermedia As The Engine Of Application State. It is a key constraint in REST that is often overlooked. Basically, every response describes how the API can be used, by providing the URIs for allowable actions within each response. The PUT or POST method should not be used to create a resource. You can use the GET operation which has view-only rights HATEOAS stands for Hypermedia As The Engine Of Application State. It is a key constraint in REST that is often overlooked. Basically, every response describes how the API can be used, by providing the URIs for allowable actions within each response. XML and JSONWhat is REST API?
List the RESTful API architectural constraints?
What are the HTTP methods?
HTTP method
CRUD
Action
GET
read
returns requested data
POST
create
creates a new record
PUT or PATCH
update
updates an existing record
DELETE
delete
deletes an existing record
What are HTTP headers?
What do you know about JAX-RS?
What is use of URI?
What are the Pros and Cons Statelessness?
What are the important testing tools for Web services?
What is the use of OPTIONs method?
What are HTTP status Codes in REST API?
What is Payload?
What are the HEADGET, OPTIONS, TRACE methods?
What is HATEOAS?
Do you know GET request to be used instead of PUT to create a resource?
Can you define HATEOAS?
Which Mark-up languages are used in REST API?
What are best API testing tools?
Related posts:
- Bootstrap Interview Questions and Answers
- CSS3 Interview Questions and Answers
- DHTML Interview Questions and Answers
- Drupal Interview Questions and Answers
- HTML Interview Questions and Answers
- PHP Developer Interview Questions and Answers
- SOAP Interview Question and Answers
- SoapUI Interview Questions and Answers