Part 3 - Test the API with Browser and/or Postman

Once your Elastic Beanstalk environment is deployed and the status shows as “Environment is healthy” on the environment pane, either click the URL shown at the top of the pane to launch a browser, or type in the URL you set earlier (<subdomain>.<region> Follow the steps below to test out the API with a browser, and then optionally using Postman.

1. In your browser, append ”/api/values” (no quotes) to the URL to call the default Get() method on the ValuesController. Your browser should display the JSON for “value1” and “value2” (some browsers may prompt you to download the file first).

2. Next, you can (optionally) test your API with Postman. Create a simple request in Postman, using the same URL (including /api/values), and test it using a GET request.

3. To test your request using PUT and POST requests, you will need to add the Content-Type header to your request, with the value set to “application-json” (no quotes). The PUT request also requires an id value to be passed in the URL, of the form /api/values/id (where id is an integer), so for example, /api/values/5 for a PUT request passing 5 as the id value.

*Note: If you’re not familiar with Postman, refer to the * Postman documentation on sending requests.

4. Verify that for the GET request, the response includes the same json as when you tested with your browser. The PUT and POST requests won’t return any data, but the response HTTP type should be “200 OK”.

You have now tested your API by accessing it directly on the EC2 instance on which it’s running.