Skyscanner - Software Eng - Task 1
Skyscanner - Software Eng - Task 1
6. Modify the run method to register our new resource. This will expose the /search
endpoint on the microservice. Modify the run method to match the following code
snippet:
7. Click the run button again to reload your microservice.
8. At this point, the application should be fully functional. All we need to do now is test it!
a. Download Postman, a polished GUI for sending HTTP requests and testing Rest
APIs.
b. Open it up after installation and follow the prompts to create an account or click
skip and go to the app.
c. Under the Get Started sidebar on the right, click Create a Request.
d. In the request method section, change GET to POST.
e. In the Enter Request URL input box, add localhost:8080/search.
f. Select the Body tab of the request.
g. Select the Raw radio button.
h. Select JSON from the formatting dropdown.
i. Enter the following request body to search for results in the city of Petalborough:
{"city": "petalborough"}
j. Click Send.
k. The above steps will submit a POST request to our microservice with a JSON
body representing a search for all rental cars and hotels in the city of
Petalborough. You should see a list of these returned in the response section.
Congrats, your application is up and running! Try the cities of Rustburg and
Shaleport (lowercase), as well as some invalid searches to make sure
everything works as expected.
9. All that’s left now is to submit your work, commit and push your changes and pass along
a URL to your repo below.