Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Debugging an API

Updated on 2024-04-03 GMT+08:00

Scenario

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

NOTE:
  • 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 created an API group and API.
  • You have set up the backend service of the API.

Procedure

  1. Access the shared gateway console.
  2. In the navigation pane, choose API Publishing > APIs.
  3. Debug an API. You can use one of the following methods:

    • In the Operation column of the API you want to debug, choose More > Debug.
    • Click the name of the target API, and click Debug in the upper right corner of the displayed API details page.
    Figure 1 Debugging an API

    On the left side, set the API request parameters listed in Table 1. On the right side, view the API request and response information after you click Send Request.

    Table 1 Parameters for debugging an API

    Parameter

    Description

    Protocol

    This parameter can be modified only if you set Protocol to HTTP&HTTPS for the API.

    Method

    This parameter can be modified only if you set Method to ANY for the API.

    Suffix

    You can define a path only if you have set Matching to Prefix match for the API.

    Path

    Request path of the API.

    Path Parameters

    This parameter can be modified only if you have defined path parameters (such as {test}) for the API.

    Query Strings

    Query string parameters and values.

    Headers

    HTTP headers and values.

    Body

    This parameter can be modified only if you set Method to PATCH, POST, or PUT for the API.

    NOTE:

    The fields displayed on the debugging page vary according to the request type.

  4. After setting request parameters, click Send Request.

    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.

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

    NOTE:

    To modify the API configurations, click Edit in the upper right corner, and modify the parameters on the Edit API page.

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 of the API, create request throttling policies (see Creating a Request Throttling Policy), access control policies (Creating an Access Control Policy), and signature keys (Creating and Using a Signature Key) for the API.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback