postman

Hitting API endpoint with GET verb and parameter value=40


I need to hit this endpoint as part of an assessment, I have tried having a looking online and I would ideally like to do this just by using the browser console.

This is my task:

Your task is to write some code (eg. console, html form, javascript, python etc.) to hit 2 API endpoints. You can use any language, framework, tool or library. The result of each endpoint will give you instructions on how to proceed. The first endpoint is /api/Step1 and requires a GET verb and a parameter value=40

I am really trying to understand how to do this but all of the things I have read have not worked.

Any help would be greatly appreciated.

[Postman]


Solution

  • You should make sure you get the idea of what an API is, and you can read this for the queries.

    That said, you are looking to send a GET http request to the url /api/Step1?value=40. You can to this using a tool like Postman on Chrome, but there are other equivalents for other browsers.

    If you are using osx/linux, you can look up the command curl on google to see how to do a GET request from the terminal, or check this SO question.