22 October 2020

#Spring_Rest

Spring Rest
What does REST stand for?
What is a resource?
What is the HTTP status return code for a successful DELETE statement?
What is differences between RESTful web services and SOAP web services?
What is an HttpMessageConverter?
How to create a custom implementation of the HttpMessageConverter to support a new type of request/responses?
When do you need @ResponseBody?
Is REST normally stateless?
What are safe REST operations?
What are idempotent operations? Why is idempotency important?
What are the advantages of the RestTemplate?
What is an HttpMessageConverter in Spring REST?
What does @RequestMapping annotation do?
What is the difference between @Controller and @RestController?
What does @PathVariable do in Spring MVC? Why it's useful in REST with Spring?
What is the HTTP status return code for a successful DELETE statement?
What does CRUD mean?
Which HTTP methods does REST use?
How to create a custom implementation of the HttpMessageConverter to support a new type of request/responses?
When do you need @ResponseBody annotation in Spring MVC?
When do you need @ResponseStatus annotation in Spring MVC?
When such exceptions are thrown from the controller's handler methods and not handled anywhere else, then the appropriate HTTP response with the proper HTTP status code is sent to the client.
Where do you need @EnableWebMVC?
Do you need Spring MVC in your classpath for developing RESTful Web Service?
Does REST work with transport layer security (TLS)?
Is REST scalable and/or interoperable?
Is REST normally stateless?
Is @Controller a stereotype? Is @RestController a stereotype?
Is REST secure? What can you do to secure it?
  • There must be a service producer and service consumer.
  • The service is stateless.
  • The service result must be cacheable.
  • The interface is uniform and exposing resources.
  • The service should assume a layered architecture.
  • RESTful web services are platform-independent.
  • It can be written in any programming language and can be executed on any platform.
  • It provides different data format like JSON, text, HTML, and XML.
  • It is fast in comparison to SOAP because there is no strict specification like SOAP.
  • These are reusable.
  • They are language neutral.
  • Path
  • PathParam, FormParam, QueryParam, HeaderParam, CookieParam
  • Produces, Consumes
  • Bounded Context
  • Two Factor Authentication
  • Client certificates
  • OAuth
  • Conway’s law
  • GET: It reads a resource.
  • GET /users/{id}: It retrieves the detail of a user.
  • GET /users: It retrieves the detail of all users.
  • GET /users/{id}/posts/post_id: It retrieve the detail of a specific post.
  • POST /users: It creates a user.
  • POST / users/{id}/ posts: It creates a post of the user.
  • DELETE: It deletes the resource.
  • DELETE /users: It deletes all users.
  • DELETE /users/{id}: It deletes a user.
  • PUT: It updates an existing resource.
  • PATCH- It update partially

No comments:

Post a Comment

Most views on this month