Use the API Gateway console to test a REST API method - Amazon API Gateway
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Use the API Gateway console to test a REST API method

Use the API Gateway console to test a REST API method.

Prerequisites

Test a method with the API Gateway console

Important

Testing methods with the API Gateway console might result in changes to resources that cannot be undone. Testing a method with the API Gateway console is the same as calling the method outside of the API Gateway console. For example, if you use the API Gateway console to call a method that deletes an API's resources, if the method call is successful, the API's resources will be deleted.

To test a method
  1. Sign in to the API Gateway console at https://console.amazonaws.cn/apigateway.

  2. Choose a REST API.

  3. In the Resources pane, choose the method you want to test.

  4. Choose the Test tab. You might need to choose the right arrow button to show the tab.

    Enter values in any of the displayed boxes (such as Query strings, Headers, and Request body). The console includes these values in the method request in default application/json form.

    For additional options you might need to specify, contact the API owner.

  5. Choose Test. The following information will be displayed:

    • Request is the resource's path that was called for the method.

    • Status is the response's HTTP status code.

    • Latency is the time between the receipt of the request from the caller and the returned response.

    • Response body is the HTTP response body.

    • Response headers are the HTTP response headers.

      Tip

      Depending on the mapping, the HTTP status code, response body, and response headers might be different from those sent from the Lambda function, HTTP proxy, or Amazon service proxy.

    • Log shows the simulated Amazon CloudWatch Logs entries that would have been written if this method were called outside of the API Gateway console.

      Note

      Although the CloudWatch Logs entries are simulated, the results of the method call are real.

In addition to using the API Gateway console, you can use Amazon CLI or an Amazon SDK for API Gateway to test invoking a method. To do so using Amazon CLI, see test-invoke-method.