如何在邮递员中自动生成此有效负载。请看下面的结构。
我只更改有效负载中的帐号/帐户名称。如果我为一个客户 ID 添加了 200 个帐户,我将不得不在数组中插入 200 个单独的结构。有没有更好的方法来动态维护和生成有效负载,因为我知道只有 2 个字段正在更改,我可以将它们作为变量传递。我尝试了 Collection Runner,但我无法将这些作为一个请求发送。
仅供参考 - 对于另一家公司,它将是 100 或 50 或 500,我希望对任何请求使用相同的有效负载。
仅供参考 - 需要在一个请求中传递所有这些帐户是因为任何第二个请求都被服务器视为修改。
{
"context": {
"EID": "ACC_123",
"eventTime": "2018-01-02T00:00:00.000Z",
"Eaction": "INIT"
},
"payload": [
{
"accountNumber": "12345",
"accountName": "abcd",
"accountAliasName": "",
"customerId": "150740000",
"ccy": "THB",
"accountStatus": "A",
"branch": "001",
"bankCode":"0001"
},
{
"accountNumber": "123456",
"accountName": "abcde",
"accountAliasName": "",
"customerId": "150740001",
"ccy": "THB",
"accountStatus": "A",
"branch": "001",
"bankCode":"0001"
}
]
更新-
前置要求:
payloadarr.push(
{
"accountNumber": Account_Number ,
"accountName": Account_Name,
...
"context": {
"eventID": "TEST_JSL_0120191",
"eventTime": "2018-01-02T00:00:00.000Z",
"action": "INITIATE"
},
"payload": [payloadarr]
身体:
{{AccountActivation_Payload}}
...
请求通过:
{"context":{"eventID":"TEST_JSL_0120191","eventTime":"2018-01-02T00:00:00.000Z","action":"INITIATE"},"payload":[[]]}
期望:有效载荷应该具有附加值
{"context":{"eventID":"TEST_JSL_0120191","eventTime":"2018-01-02T00:00:00.000Z","action":"INITIATE"},"payload":[{
"accountNumber": "12345",
"accountName": "abcd",
"accountAliasName": "",
"customerId": "150740000",
"ccy": "THB",
"accountStatus": "A",
"branch": "001",
"bankCode":"0001"
},]}