springboot - restTemplate post request 构造测试用例
1.定义post endpoint
2.通过payload java对象定义post body以及headers,传递给 HttpEntity()
EvPlannerPayload requestPayload
request = new HttpEntity<>(requestPayload, headers);
3.call RestTemplate 对象exchange 方法,分别传递4个参数,传递url,http 请求方法,HttpEntity对象,响应对象
resp...
原创
2022-04-20 00:20:58 ·
646 阅读 ·
0 评论