This topic describes how to use Postman to debug Spring Cloud or Dubbo service APIs that are deployed in the cloud.
Background information
Service APIs in the cloud are typically accessible only from within a cluster, which makes testing and validating them difficult. EDAS provides a Postman integration to simplify this process. When you run a Postman script, EDAS starts a cloud testing engine to call the API. This improves the efficiency of API testing and validation. The following figure shows the overall process.

Permissions
To prevent accidental calls to APIs in your cloud environment, you need the following permissions before you run a Postman script.
Read permissions on the target application: This permission lets you select the application to access its APIs.
API access permissions: This permission lets you call the APIs.
-
Log on to the EDAS consoleEDAS console.
In the navigation pane on the left, choose System Administration > Permission Assistant.
On the Permission Assistant page, click Create Policy.
On the Create Custom Policy tab of the Create Policy wizard, set the Policy Name and Note.
On the Create Custom Policy tab, click Add Authorization Statement. In the Add Authorization Statement panel, set the application's view and API access permissions, and then click OK.
For Effect, select Allow.
In the permission list on the left side of the Authorize Operations and Resources section, select Application > View Application and Application > API Access. In the resource list on the right, set the Region, Microservices Namespace, and Application as needed.

In the Create Policy wizard, click Next.
On the Preview Policy tab, preview the permissions. Follow the on-screen instructions to create a custom policy in the Resource Access Management (RAM) console and grant the permissions to the RAM user. Then, click Finish. For more information, see Step 3: Create a RAM user and grant permissions.
After the policy is successfully granted, a message is displayed. Click Return to List to go to the Permission Assistant page and view the new policy template.
Procedure
Step 1: Export the Postman script
-
Log on to the EDAS consoleEDAS console.
In the left navigation pane, choose Traffic Management > Microservice Governance > Spring Cloud (or Traffic Management > Microservice Governance > Dubbo).
On the Service Search page, click Batch Export Postman. Download and decompress the ZIP package.
Step 2: Import the script into Postman
Download and install the Postman application. Then, open Postman.
NoteThe Postman version must be v8.3.0 or later.
Click Import, select the file that you decompressed in Step 1: Export the Postman script, and then click Import again.
After the import, the page appears as shown in the following figure:

①: The name of the microservices namespace/application.
②: The service name.
③: The method (or API) under the service.
Step 3: Configure the AccessKey ID and AccessKey secret
Click the imported microservices namespace/application name. On the Variables tab, enter your AccessKey ID and AccessKey secret in the INITIAL VALUE or CURRENT VALUE column.
After the configuration is complete, click the
icon to save.
Step 4: Send the Postman request
Click the method (or API) under the service, and then click Send. You can customize the parameters of the method (or API). For more information, see Parameter settings.
NoteWhen you send a request for the first time, the cloud testing engine must be initialized. This process takes about 20 to 30 seconds. After the engine is initialized, it remains active for one hour.
Click Console to view the initialization process.

After the call is successful, switch to the Visualize page to view the request result.
(Optional) Step 5: Call a specific service provider IP address
By default, when you run the script, EDAS queries all available providers for the current service and selects one to call. If you want to call a specific service provider, you can specify its address in the following ways.
Dubbo services
Address format: dubbo://Service-Name@IP:Port/Method(Parameters)
Example:
dubbo://org.apache.dubbo.springboot.demo.DemoService@192.168.0.100:20880/echo()This example specifies calling the service provider at
192.168.0.100:20880.org.apache.dubbo.springboot.demo.DemoServiceis the service name,echois the method name, and the parameters are empty.

Spring Cloud services
Address format: http://Service-Name@IP:Port/Path
Example:
http://service-provider@192.168.0.101:8080/echoThis example specifies calling the service provider at
192.168.0.101:8080.service-provideris the service name, andechois the path.

Parameter settings
EDAS lets you send requests to Spring Cloud and Dubbo services using Postman. The following sections describe the parameter settings for both types of services.
Spring Cloud parameter settings
For Spring Cloud APIs, the following parameters are supported.
Parameter |
Format |
Support |
Params |
Key-value pair |
|
Auth |
None |
|
Headers |
Key-value pair |
|
Body |
form-data |
|
x-www-form-urlencoded |
|
|
raw |
|
|
binary |
|
|
GraphQL |
|
Dubbo parameter settings
For Dubbo requests, you can set parameters in two ways: form-data and raw (JSON).
form-data
The Postman script exported from the EDAS console pre-populates the API parameter keys. You can simply enter the parameter values, as shown in the following figure.

The following are examples of API parameters.
API parameter |
Example |
Note |
|
|
The API uses two parameters. The first is an integer and the second is a string. |
java.util.Map |
{"color": "blue"} |
Map parameters use the JSON object format, enclosed in curly braces: {"color": "blue"}. |
java.util.List |
["Apple", "Banana", "Orange"] |
In this example, the API parameter is a List type with string elements. List parameters use the JSON array format, enclosed in square brackets: ["Apple", "Banana", "Orange"]. |
com.test.User |
{"id": 100, "name": "Sam"} |
In this example, the API parameter is a custom User type, which contains |
AbstractUser |
{"id": 100, "name": "Sam", "class": "com.test.User"} |
In this example, the API parameter is defined as the abstract class AbstractUser. In the actual parameters, you must use the class property to specify the actual type of the parameter, such as "class": "com.test.User". |
raw (JSON)
You must submit parameters as a JSON array, as shown in the following figure.

The following table provides examples of JSON arrays for different API parameters.
API parameter |
Example |
Note |
<Empty> |
[] |
The API has no parameters. Pass an empty JSON array. |
<int, java.lang.String> |
[100, "Jack"] |
The API uses two parameters. The first is an integer and the second is a string. |
<java.util.Map> |
[{"color": "blue"}] |
Map parameters use the JSON object format, enclosed in curly braces: {"color": "blue"}. |
<java.util.List> |
[["Apple", "Banana", "Orange"]] |
In this example, the API parameter is a List type with string elements. List parameters use the JSON array format, enclosed in square brackets: ["Apple", "Banana", "Orange"]. |
<com.test.User> |
[{"id": 100, "name": "Sam"}] |
In this example, the API parameter is a custom User type, which contains |
<AbstractUser> |
[{"id": 100, "name": "Sam", "class": "com.test.User"}] |
In this example, the API parameter is defined as the abstract class AbstractUser. In the actual parameters, you must use the class property to specify the actual type of the parameter, such as "class": "com.test.User". |
Feedback
If you have any questions, join the DingTalk group (ID: 34556175) to contact product technical experts for assistance.
