pm.resonse.to pm.response pm.test和pm.expect
//状态返回码判断
pm.test('status 200', function(){
pm.response.to.have.status(200);
});
//状态返回值判断
pm.test('status string OK', function(){
pm.response.to.have.status("OK")
});
//返回header的key来判断
pm.test('header have key Date ', function(){
pm.response.to.have.header('Date')
});
//返回header的key-value来判断
pm.test('header have key "Content-Encoding" ', function(){
pm.response.to.have.header('Content-Encoding', 'gzip')
});
<