From the course: Building RESTful APIs in Laravel

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

GET (show) a specific petition

GET (show) a specific petition

From the course: Building RESTful APIs in Laravel

Start my 1-month free trial

GET (show) a specific petition

- [Instructor] Let's tests the show method and display a single petition, our newly created petition with ID 51. Create a new request, call it a, GET a petition and make sure that the GET method is selected. Let's see the route list again to see what our end point is. API/petitions/petition is the URI which means we have to add a petition ID at the end of the URL string. Let's go back to the first GET request we created to copy the URL again. Notice that as we selected, Postman offers us to set it as variable. What it means is that instead of copying or typing the whole URL over and over again, we can save it in a shorter and simpler variable. In our case, the URL isn't very long and complicated but sometimes you might work with really complex URLs with parameters. And in this case, setting it up as a variable might be useful. Let's do it together just to see how it works. Click set as new variable and give it a…

Contents