Java Spring Boot REST API JSON Response Handling Tutorial with Demonstration

preview_player
Показать описание
Learn how to generate custom responses in Java Spring Boot REST API application and return custom json responses back to REST Client.
Building REST API using Spring Boot framework is highly in demand skill currently and it also helps building Microservices very efficiently. Java Spring boot REST API project often demands to have responses back in a particular format and hence this session will be extremely useful for java spring boot developers. In this tutorial we will discuss, how generic json response looks like and then how to transform that to custom response. We will evolve CloudVendorAPI application and make it capable to generate and return custom rest api responses back to rest client with the help of ResponseEntity. We will do required java code changes and then test spring boot application using Postman tool.
We will see how to construct response which will have response message, required HttpStatus and data provided from mysql database, changes in the controller layer and finally respond back to rest client.
Kindly watch the complete session to understand it completely.

Some Key points for REST API -
REST APIs also called as RESTful APIs
REST = Representational State Transfer
API = Application Programming Interface
REST is a set of architectural constraints, not a protocol or a standard. API developers can implement REST in a variety of ways
A REST API is an application programming interface that follows the constraints of REST architectural style and allows for interaction with RESTful web services
REST APIs work over HTTP
Delivers information using any one of the following formats -
JSON (Most popular) , Text , HTML , XML , Javascript and more

Spring Boot Key points -
@SpringBootApplication for starting
Easily create stand-alone, production-grade Spring based Applications
Tomcat, Jetty are embedded
Provides starter dependencies
Automatically configure Spring and third party libraries
Provides production ready features such as health checks, metrics, etc.
No code generation, No XML configuration

Link for 1st Spring Boot session -
Link for 2nd Spring Boot session -
Link for the 3rd Spring Boot Session -
Playlist for Spring Boot How To tutorial is -
GitHub link for CloudVendorApi code -

Kindly subscribe to the channel for getting regular updates of the new sessions/ courses on Software / Computer Application topics by clicking below link or you can also subscribe by clicking on ‘Subscribe’ button on your screen -
Follow me on -

Support the channel with your Amazon purchase -
Good Books to spend your time with -
Disclosure, I use affiliate Amazon links above. Purchasing through these links gives me a small commission to support videos on this channel -- the price to you is the same.

Thank you for remaining connected with the channel.

#thinkconstructive #eshapuri #springboot

Queries
how to build custom response in spring boot rest api application
how to generate custom response in spring boot rest api application
how to build custom response in spring boot
how to generate custom response in spring boot
how to build custom response in java spring boot rest api application
how to generate custom response in java spring boot rest api application
what is json response
what is json custom response
how to create custom json response in rest api
what is generic response in rest api
what is generic response in rest api in spring boot
what is generic response in rest api in java spring boot
how to test rest api with postman
how to test crud rest api
what is spring boot
what is rest api
what is postman

Chapters
00:00 Welcome note
00:43 Introduction of Response Handling in Spring Boot REST API Application
02:32 Demonstration of Response Handling in Spring Boot REST API
05:57 Response Handler Coding and Explanation - Demonstration of Response Handling in Spring Boot REST API
10:34 REST Controller Layer coding and explanation - Demonstration of Response Handling in Spring Boot REST API
13:36 POSTMAN testing and checking the JSON Response format - Demonstration of Response Handling in Spring Boot REST API
15:36 Summary
16:32 Thank You
Рекомендации по теме
Комментарии
Автор

Java Spring boot REST API project often demands to have responses in a particular format and hence this session will be extremely useful for java spring boot developers who are particularly developing REST APIs. Kindly watch the complete session to get complete benefit from this.
GitHub link for CloudVendorApi code -
Happy learning.
Cheers,
Esha

ThinkConstructive
Автор

thanks mam for showing the new way to achieve custom response... i have achieved this result by creating lots of DTO classes...but now i got this technic...thanks again for creating awesome content...

theshivrajofficial
Автор

Thank you ma'am for your awesome lecture very well explained

debanathswain
Автор

Hi
Your explanation is very clear.
I have few questions..
Why don't you just create generic object contains T response, String status and String message? In addition, you can use Lombok builder or to implement builder by yourself..

tomermadmon
Автор

Learning lot from your sessions. Thank you

mithleshpuri
Автор

Hi, where to learn Spring from ? Do you have a youtube video for that

DeepakLalchandaniProfile
Автор

could you please give me one session about doing Json Pars in spring boot application and simplifies?

narendra
Автор

Hi how can we write the responses for each endpoint in a file and put it in folder resources..thanks

oligooliogo
Автор

Thank you for how to create custom json response.
could you make a video to get and access C# json response in springboot app using java.
because C# json response contains meta field, data field and status field.

RAJ
Автор

Hi can you make session on

Spring security

For enterprise level application

That would be helpful for me and my friends
Who are working on the project

Thanks in anticipation
Yarra Raviteja

yarraravitejaskpbpmlule
Автор

Hello ma'am
I think you also perform change on service package like CloudVendorService and it's implementation class because this method comes from service package.
Thank you.

sayyadaareesh
Автор

its ok to return null as a responseObject and a status code 404 when you cant find that object in the database? thanks you!

sebastiansagrario
Автор

Very Usefull..Thanks For Sharing Informative Content.

zuberdiwan
Автор

Very simple to the point JSON Response Handling example!

pranaypaul
Автор

Awesome tutorial. What about getting back all cloud vendors in the form of an array plus status and message?

baharmahammad
Автор

Using ResponseEntity or using custom responses, which one is better ?

giangnguyenthetruong
Автор

i learned a lot from you madam ji, tqsm🌹

RjDBIIPL
Автор

Thanks Mam.. U have helped me save a lot of time in handling this usecase.

audiv
Автор

Thanks for this. How do we get the same kind of Json response for getAllCloudVendorDetails?

rhodesjh