10,606
社区成员
发帖
与我相关
我的任务
分享
//MOC接口的地址http://{domain}:{port}/moc/task/distribute
String mocTaskDistributeUrl = "http://192.168.1.91:8030/moc/task/distribute";
DeliverChangeParameter[] deliveringChanges = getRequestBody(deliveringChangeId, deliveringHostIp);
//接收MOC的返回消息
//为rest请求准备请求体
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<DeliverChangeParameter[]> httpEntity = new HttpEntity<DeliverChangeParameter[]>(deliveringChanges);
//发送请求
UpdateResult updateResult = new UpdateResult();
updateResult = restTemplate.postForObject(mocTaskDistributeUrl, httpEntity, UpdateResult.class);