REST Request-Response

Subhash Chandra Basavaraju
A free video tutorial from Subhash Chandra Basavaraju
Test Automation Architect, Automation testing Lead,
4.3 instructor rating • 5 courses • 18,082 students

Lecture description

In this lecture, i will explain the concept of request-response, how to send request and read the response. I also explain the components and configuration of request/response

Learn more from the full course

REST API WebService Automation Testing-ReadyAPI-SoapuiNG PRO

REST API WebService Automation and Manual testing using soapui- soapuiNG Pro ReadyAPI + 2 REST API WebService 4 practice

07:47:35 of on-demand video • Updated January 2020

  • REST API Webservice testing using Manual and Automation testing using ReadyAPI and Soapui
  • Develop advanced Automation test case using groovy script to test REST API Webservice
  • Crack REST API Webservice Job interviews
  • Learn couchbase Database interaction with API Web-Service
  • 2 REST API Webservice projects connected to MySQL and Couchbase DB for learning
  • Configuring the Environments in Ready API SoapUI NG PRO
  • Building Mock Services using ServiceV Module withing ReadyAPI tool
English [Auto] OK. So this is the first step here. There is no project nothing. Go to new project since we are learning the rest. AP are testing launching new resh project and go to the EPA documentation. First thing you need to do is you need to copy this slash customer. These are live Source column copy this content go back to you. I copy pasted. Click on OK you got a window here. I just explain what this window is about. On the left side you'll see DC's Explorer. So just like the other tree navigation. So again just expand collapse and this part. It's totally from the air. This is called a request tap. Yes. You need to send the request a data or whatever you put the that has to be mentioned here. This is called the Quest tap and this part that snottily itself response it's a response step. So as I mentioned earlier it's Saqlain the observer architecture where you need to send the request to the server and you'll get the response that is displayed in this light tap. So on the top you and other important things to notice so whatever information we copied from the web page that the documentation PRCA the piece that comes under the source is the end point which is say no and bind said we will send them. And is the method method I already told you what method is about the same thing needs to be chosen here in this section we will provide the parameters. This is the overview of this tool. Now let's go and send the request. Now it's saying there is no end point set. This is High-Level is a project for the disease is our salaries folder. I just opened this yardage center service and points and I need to add new endpoint. So where can I get the endpoint. You need to go back to my vba documentation on the top. I am mentioned here as an end point. So copy this and come here just copy paste this. Click on OK on and find it said click on this. Then just assign button will be activated. Click on this. Yeah you need to select colored quests and distinguished click Kockott go back to our actual requests actual request. Step base this one click on this. Now we came back and we see the end point is set here. When I click on this this is a drop down box so there are a lot of methods available Materne in the sense actions. So get forced to delete and options trace and batch so generally get forced put delete of the used. Popularly used method which I will be calling your head options. Plays are rarely used. Another name of this method are called crude methods. C R U D. C stands for create and R stands for lead. Use stands for update and D stands for delete. This is the expansion of this. The same thing is mapped to the methods also known as actions create means creating the data. As I mentioned earlier we use post method lead get method and you update updating the existing data or modifying the existing data. Put method is used so obviously it means deleting the data from the database. So we add a same delete named method. This is all about matics as I mentioned earlier. We need to create the data so there is no data exists in a database so we need to create the data. We go back to our JPA documentation so Yadier documentation geuss the detail information about the results PPA how to use it. What are the parameters we need to send and what are the schema syntax and what the status quo do you get. So this whole information held off whatever the status quo. Later to display information documentation will provide. Now to create a date what we need to do is to do of course there's a master card posted and this is resource and really pyramidalis is not applicable and bought Palamedes are also not applicable. Request Barty's schema schema in the sense kind of you can relate that to the syntax it says the quiz bodies Kiama should be this one. But just copy this. So you should notice this and that design. They already told you what is dishonest. So this is a decent format copy this entirely to the request section. This is the request section. Now the question is will the copy paste you need to select method as poss because of the one used to create an data. So as soon as you choose the post this particular editor appeared. So if I go back in to get Look it disappears I'll tell you why go and choose the post and the editor type on the request block is a little. So I just copy paste this to make sure the media type is on and the media you will get a lot of options like application just on a package an example. This is something very specified to the set of what Farman we are sending that data. So in our case we are sending the day die in design format so you need to choose the design if that is not chosen by default you need to choose it. Now it says doing all this clean should be replaced with the actual value as a quarterly O.J.'s on his name value a key value pair. I would just say spring means it takes some data. I'll mention it in court. I will do some randomly. You can do your own name it name last name I'll say your name phone number is an integer. So you do not are to enclose this in double quotes. So I will just give one two three four five six unit. It's a string within double cords specify a human and say a b c d e at gmail dot com and at. I will give get just a sample I just like one two three for some street city I will say and I'll say Ted I will say. And spade. Just a random name zip code. It's an integer. So you need Bigloo numerics here and country you need to get the content in that is again should be enclosed within the court because it's a string. I will say England are up running circles that are always running really take the data all you need to do right now is to hit this green button he says submit request to specify an endpoint. Click this. We'll see what happens. You say it's content your point of view cannot be viewed as an accident. OK I'll click on days on Debian. So if you see there are multiple taps available I get a similar type on tab tab and Rodda so days on tap. If you see this design tab Yeah we got a response like decision that request when we send the request to our server and we got the response. If you see there is a difference between the request and the response response we got a customer ID right. That means we sent the request as a customer details and it created a customer ID and it sent the same details again with the auditors as in the square bracket means it's a list the list in adjacent tab you can view the response in a different format. That is what it means. There's one more time which is very much interesting is what happened right there again going in the same response in a day format. But it is not properly formatted to see a design but the data are the same. However it contains an extra day. This is called metadata made that it contains a status called and it contains the date. And it also contains a Castamere the order is clear that this entire section is called header. You should remember this one this is called. That in that regard. The stammeringly and we are the status quo. Let's go back and see in the documentation we use the post-Mandela and using this schema format we failed that day actually. But placing this in the the data type and we got the response tool not one created and then the response Kiama you can see why do they expect that response schema. This is the expected one. So in your documentation they will provide what kind of data you need to send in which format. What are the parameters. Whether it's a paramita but baramin which Albert Dilling you in few minutes. And the method which you need to use request body and response schema you forget does state as as to not one that means you get a response. And if you get the response this is the key I should be dead. So forget about the art link the way it is are the values the pay is. So one thing you should consider is key should be proper. So first name should be proper. The same thing what we are sent now. How fortunate that they are let's go and see a baby. What it has been posted. I'll go and open my. My sequel workbench. I click on this select Start from my zone. Customer will pull up all the data in a database in customer table. So when this data go there's the magic yes. So it created the same data. Now what we are sent on the first name that's clearly a name last name and email and whatever. I just now send in the request body of my reps address the two main things added our creation date. This will be added by the web service itself and customer IDs system generally. Generally this is all we send the request and lead the response. So I'll talk more about it in the next session.