如何在 selenium 中使用 RestAssured 发布以下请求。
请求如下:
{
"ShipmentID": "",
"ShipmentNumber": "123455-6",
"Comments": "",
"LineIDs": [
{
"ShipmentDID": "",
"AssetNum": "759585",
"FileC": "",
"SerialN": "",
"LineID": "5",
"Status": "Accept",
"TransferCancelComment": ""
}
下面是我使用的代码,但不确定我应该如何继续“LineID”,因为它的属性很少。
@Test
public void TransferIn() {
RestAssured.baseURI="testurl.rest.com";
RequestSpecification httpRequest = RestAssured.given();
JSONObject requestparams=new JSONObject();
try {
requestparams.put("ShipmentID", "");
requestparams.put("ShipmentNumber", "123455-6");
requestparams.put("Comments", "");
requestparams.put("LineIDs", "");
}