0

我必须发送一个数组,如:

1.

"market": [ "UK" , "US" , "PK"],`

2.

"units": [{
    "id": ObjectId("59762d7caddb13b4a8440a4g"),
    "name": "unitName-1"

},{

    "id": ObjectId("59762d7caddb13b4a8440a5g"),

    "name": "unitName-2"

}]

我知道在 Spring STS 工具中发送 post/put 请求的键值对格式如下:

http().client(attributeClient) //
    .post("/") //
    .payload("{ \"name\": \"attribute1\","
            + "\"description\": \"this is description\","
            + "\"market\": \"UK\","
            + "\"helpText\": \"this is helptext\","
            + "\"type\": \"text\","
            + "\"required\": \"false\","
            + "\"repeatable\": \"false\","
            + "\"readOnly\": \"false\","
            + "\"systemLevel\": \"false\","
            + "\"units\": \"false\","
            + "\"codedValues\": \"false\","
            + "\"mask\": \"XX-XX-XXXX\","
            + "\"length\": \"100\","
            + "\"industryId\": \"false\"}") //
    .contentType(APPLICATION_JSON_VALUE) //
    .accept(APPLICATION_JSON_VALUE);

如何发送上面指定的数组?

4

0 回答 0