#16 RESTful Web Services | Recap

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
it's time to make a quick recap so till this point what we have done is we have worked with different methods of HTTP right we have worked with get requests we have work with post foot and did it and you can see we have used we also we have also used a postman as a tool to send a request to the server and everything was working fine right and we have enjoyed the video still this point now if you observe this scenario here what we are doing is so in terms of recap what we are going to do now is let's try to understand what are things we have done for it let's do with the get request so let's say if I use the sense of get request and a user user intention is to fetch all the aliens here for that we have written this method which returns all the aliens now as you can see we have get aliens method now this method will be called whenever you request for the aliens so this path annotation will map your request right so which is when you request for alien this was a map it and you can return all the aliens but again in for Mikey returning them so we are littering them in a nice format now you might be thinking can you can you really send at least format to the user because user will be a client right it may be a browser it may be ended application so of course we have to convert this Java object into some format which is understandable or with all the application and that's where XML and Jason comes into picture okay but the question arise how will it convert your Jay Deal object into JSON format so we don't have to worry about that like remember in your libraries we have added one of the dependency okay instead of opening this we should be opening our XML or not this XML the power maximal files now in this table we have seen that some dependency is using which you can convert and luckily or we have Joe see here now Justin says here user or hippo gramma you just have to give the object it is my job to convert that object into XML format but then what if you want Jason so for Jason we need or one we need one more dependency which is voxi right again we can also use Jesus you can Jackson if you love it but just to say hey why you have to add extra libraries when I can provide you those libraries so here you think Jersey library here but you have a choice right we can also choose between Jason and Jackson and also of this one which is Maki okay so we have added these dependencies using which you can convert your object into either XML or JSON it's just that when you return you have to mention what it produced now your application says see I can produce a JSON data or I can produce a XML data now depend upon what our user requests for you for user is requesting for XML you will return XML for you for user is requesting for Jason you will return JSON right now that is called as content negotiation so you are negotiating a content with the user and that is perfectly fine so that is about your get request right now we also need a post request or is that this is here's a post request let's say if you want to create a new alien in fact what we have also done is we have connected this thing we did a base-wide so if you create a new alien that alien will be stored in the database and to do that we have used a repository here and in this we have done with all the configuration again you could have used data source here if you have a different implementation for database you can do that our application is so this code this file here is not concerned about whatever database for you have it on there you can also fake it in fact if you remember the first few videos we were faking that we have little base wise we were using some dummy data as any storage but now we actually have masculine white everything was working you know we have a post request we can use get requests we can use put and delete so get it so the same thing is just that you have to change this annotation some foot delete we have a post and the also mentions Park now why we read apart we have was it only specify path here right now to get that link example if I go to my postman and you can see we have aliens here so if I say I want one particular area nor if I want a alien to be updated or if I want it to be deleted they say I want to delete this was your - we just have to go here just say delayed request insists and it will be deleting it will get deleted vice that's how it works so everything was working so why I mean what next we are going to do see we have Josie is not the implementation right and if you are working for a company they take a chance that you might be implementing Jersey or maybe some other implementation now one of my favorite implementation for restful Web Services is a spring good spring the worst because Spring Framework is a new plane book which provides you lots of features right if you implement spring MVC spring code it's an awesome it's not something booked to work with so what we are going to do now is we will be working with the same stuff the same get request same post request for delayed all the same thing with it a bit of course but with the help of rest spring list right so we start with spring list and let's like let's also add the database feature but that will be with the help of hibernate or maybe some jba right so let's make this more exciting let's also add database and all those stuff but then before going for all those things there are some prerequisite the first prerequisite you need to know is spring code again it's not that difficult you can just search my channel or you can just go to description area and find the finding videos for spring code those things we all need and that's it everything else will I will teach you how step I will teach you everything step by step in fact if even if you don't know spring code that's fine because when I explain you about those spring cool features while in spring rest you you will understand you would understand all those things but you don't have to worry about that okay now we of course we are going for Spring Framework right the second thing we need is also using a different IDE now earlier we were using Eclipse right again you can continue with eclipse but then it is authors by self to use advanced one specific for spring same work we have STS as a IDE you can see we have HTS here SEO stands for spring tool suite which is specially designed for spring based application again you can also use eclipse here okay it's your choice but then I will go forest year and you can also learn that right so why don't you let's expand our knowledge box and let's also learn HTS now question arise from where you will download that so I will show you the down okay let me show you that if you go to a browser let's go to okay let's go to STS this is the official it will take it off to the side of STS which is here spring to sweet you just have to download STS from here there's option of all versions you can you can click on this if you depend upon machine you use it will automate detect your OS and it will download that particular version for you you don't have to worry about this so once you click on this it will get downloaded you have to just you just have to unzip it and you can use it now you might be thinking oh we are using a new IDE now we have to learn lots of thing you don't have to worry about that because st of itself is based on Eclipse Eclipse platform so if you are using s tears internally you are using eclipse right so let's start with that in the next video we'll talk about the fast code with things list so that's it from this video if you are enjoying my sessions do let me know in the comment section and duplicate that like button if you are really enjoying it thank you so much for watching
Info
Channel: Telusko
Views: 28,318
Rating: undefined out of 5
Keywords: telusko, navin, reddy, tutorial, java, spring, framework, sts, rest, restful, web, services, jpa, get, post, produce, delete, put, moxy, jersey, download, install
Id: Q2H1fLeR8oE
Channel Id: undefined
Length: 7min 45sec (465 seconds)
Published: Tue Jul 25 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.