RESTful web services are loosely coupled, lightweight web services that are particularly well suited for creating APIs for clients spread out across the internet. And to build Web services that are lightweight, maintainable, and scalable in nature. A service which is built on the REST architecture is called a RESTful service. The underlying protocol for REST is HTTP, which is the basic web protocol. REST stands for Representational State Transfer.
We do have different types of frameworks to Develop Rest API, the following frameworks are widely used for API implementation.
Apache CXF
Jersey, the reference implementation from Sun (now Oracle)
RESTeasy, JBoss’s implementation
Restlet
WebSphere Application Server from IBM
Introduction
Project Creation and Setup your working Environment
We are going to setup your local environment to start work on the implementation.
We are going to create our First Rest API user defined method, following things we will cover
Resources
Get
Post
Run and Debug the Service
We are going to write service which will return complex type response as a XML format
Mock-up Service and Implementation
We are going to create a Mock-up repository , and write API to fetch the data from repository
We are going to create a Mock-up repository , and write API to fetch the data from repository with some specific detail. Filtering the data based on your input.
In this video we are going to setup client to invoke our Service. We can use Postman or ARC [Advance Rest Client]
We are going to Write a input and fetch the information and send back to the client. With the help of "PathParam" annotation.
Pass Input to the Service
Fetch relevant information
How to use postman to pass the input to the Service
We are going to discuss about the content filter . How to send different kind of responses like XML, JSON. Basically we are going to see how to filter the content.
Connect and Fetch Data from MySql Database
Instead of Static Repository we are going to work with real Database. We are going to work with MySQL DB.
Establish Connection to the database
Update your method to fetch the details from DB instead of Repository
CRED Operation Using MySql Database Table
We are going to Write CRUD API Service .Following API's we are going to create
Insert Data from Rest API
Write a method to Insert logic to the table
Restricting the user to send only XML/JSON format . Adding logic to our API to restrict only specific data type
We are going to Write Update API Service .Following API's we are going to create
Update Data from Rest API
Write a method to delete logic to the table
We are going to Write Delete API Service .Following API's we are going to create
Delete Data from Rest API
Write a method to delete logic to the table
Rest Using SpringBoot
In this session we are going to create Spring boot application to interact with our database.
We are going to discuss about how to use JAP to retrieve the data from our database.