anyproxy 拦截响应
通过beforeSendRequest(requestDetail) 方法实现 ,requestDetail 参数构成:
不做任何处理
return null;
修改返回状态码
var newResponse = Object.assign({},responseDetail.response);
newResponse.satusCode = 404;
return {
response = newResponse
};
修改响应内容
var newResponse = Object.assign({},responseDetail.response);
newResponse.body=newResponse.body + ‘This is test’;
return {
response = newResponse
};