Updated on 2023-05-09 GMT+08:00

Debugging an API

After creating an API, debug it on the APIG console by setting HTTP headers and body to verify whether the API is running normally.

  • APIs with backend request paths containing variables cannot be debugged.
  • If an API has been bound with a request throttling policy, the policy will not work during debugging of the API.

Prerequisites

You have set up the backend service of the API.

Procedure

  1. Log in to the APIG console.
  2. Select a gateway at the top of the navigation pane.
  1. Choose API Management > API Groups.
  2. Click a group name.
  3. On the APIs tab, select the target API and click Debug.
  4. Set request parameters and click Debug.
  5. The box on the lower right displays the response of the API request.

    • If the debugging is successful, the HTTP status code 200 and response details are displayed.
    • If the request fails to be sent, an HTTP status code 4xx or 5xx is displayed. For details, see Error Codes.

  6. You can send more requests with different parameters and values to verify the API.

Follow-Up Operations

After the API is successfully debugged, publish the API in a specific environment so that the API can be called by users. To ensure security, create policies for the API.