How to use postman for making Requests

Using Postman for making Requests

Lesson Details:
July 21, 2020

Video Transcription: Okay so now after installing postman from Google now you can open postman and this is the welcome screen which you will be greeted with this video is brought to you by our be Appy Pie’s Academy so first of all close this create new template and now the very first thing which if at all you want to do it I will show you how to start the dark dark theme so inside file we have settings and over here in themes you can toggle between the light or the dark theme okay so I personally prefer working with the dark theme but just find out what are preferences and then work along okay so with that let's get back to request okay so currently let's go back to the finance API and now let's look at the documentation of this particular API and the base URL okay or the base endpoint so currently the base endpoint is API dot by Nantz comm so let's copy it now and then over here let's make a request to HTTP colon double slash API dot finance calm okay so you can look at the variety of different types of requests which are the get post put put patch delete copy head options and more requests like that so we're at the very first point we have a get request which is being made to API dot by Nance comm okay so let's look at making a blank request so click on the blue send button and this will create the request.

If you don't have a request running already or if you don't have this workspace click on new over here and then click on request ok so you can give a name to this particular request and then it will open up ok so over here we are making a get request to API dot by Nance com ok so let's click on send and now the response which we are getting is a simple HTML file which has HTML head title and body ok so this is exactly the type of response we we are expecting so now let's do something where we can test if we are actually connected to the server and if we are getting a particular output as we want it okay so over here let's go down and inside the public endpoints so now to test the connectivity we have slash API /v 1 / ping so now we are making a get request to API /v 1 slash ping so now let's copy this endpoint let's go back to postman and over here after the endpoint let's paste it so now we have API dot - com slash API /v 1 slash ping ok so with this let's make the request so to do that we click on send ok and now the server has returned an empty object or an empty JSON object as the response ok so this is exactly what we are hoping for so first of all congratulations you are successfully connected to the by nan server and now you can make request and get response from the server and interact with it so this is just like you have established connection with the kitchen when you are talking with the talking through the waiter but now you are sure that the waiter is going to the kitchen and getting something for you so now just to get some real value from the server let's change the endpoint to API slash v1 slash pine ok so over here instead of ping let's pass in time okay so we have time over here and now the response which we are getting from the server is serve all time and then we have the value for this particular server time ok so now over here this is again a JSON object where we have a key and a value pair okay so now if you look at some more parameters in this particular request we have cookies so if the website gives any cookie to you then those cookies are stored over here then we have the header ok so first of all we have the content type and over here the type is declared where the JSON file structure is mentioned so over here we have content type which is applications last JSON JSON and then we have the date we have the server and then we have the security protocol and all of these different parameters are mentioned over here so the error code which you will get will also be mentioned inside the header file and that is what you will be looking for so now let's look at one more request which will give some more detailed output so we have exchange info.

So we have API /v 1 slash exchange info so now let's go back to postman and instead of time let's pass in exchange info over here ok and let's click send so now we will be getting some response from the server so currently over here we have the exchange information and now we are getting multiple values and this is a very big response so currently we have the status which is a 200 status so that is okay then we have 453 millisecond which is the time which has been taken for the server to give you the request or to cater the data and then this is the size of the data ok so now after this let's also get some more information or let's get some candlesticks ok so now to get candlesticks the endpoint is K lines okay so let's go back to postman and over here instead of exchange info we have key lines okay but first of all let's try something where we have misspelled the endpoint okay so I have purposefully misspelled the endpoint and let's click sync and now currently we are getting a status error of 4 0 4 which says the requested resource was not found' and this is exactly what we have hoped for because we are going to the wrong endpoint ok so now we are passing in key lines and now let us click send ok so now we again have a particular error which is of the core 400 and this is a bad request code and the message which the server is telling us is that mandatory parameters or the symbols were not sent and either those parameters were empty or null or the MAL performed okay so this is important because in the documentation of the K lines endpoint we have these particular parameters okay and we have still not mentioned the parameter of symbol or the interval okay so now let's go back to postman and let's pass in these parameters so to do that the first parameter is symbol so over here inside key value the key symbol okay and the value is ETH BTC okay and this particular value will be passed in through double quote marks and now let's send this okay so now we have the illegal characters found in symbol so this is because we have put in the double quote marks okay so let's pass in the value as simple eth BTC and now we again have the error which says that interval was not set okay so let's go back to the documentation the very first parameter which we have set a symbol which was eth BTC.

Now the error which the server is giving us is that the mandatory parameter called as interval was not straight okay so this is just how you are interacting with a particular server and getting the data from it okay so now let's go back to the documentation and now the interval parameter is not straight okay so over here let's give another value called as interval okay so now inside interval now we want to specify a particular value for the interval so let's look at some valid parameters for the interval okay so let's say we want the data of five minutes so the interval is 5m so let us go back to postman and over here we have 5m which stands for the interval and now let's send it and now as you can see we have received a response from the server okay and this is just the response which is mentioned or shown to us inside the documentation so over here let's go back to the Kaline section okay and inside key lines this is the type of response which we will be getting so we have the open time then we have the open and the high-low or the closing time then we have the volume and all of these different data points okay so this is returned as a JSON object so now this is the first candle then we have one more candle then we have one more candle so similarly a large number of candles have been returned to us by the server okay so again we have a status of 200 which is okay and then we have the time which is taken by the server to give the data back or to give you some data Kate are you with some data and then we have the size of the data which is received okay so with this we have successfully installed postman we have used postman to make request and not just to make simple requests but to make requests which taken a particular parameter okay so that is pretty much it for api's and communicating using HTTP.

Course content