This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
ProxyPin提供了一个脚本功能,开发人员可以编写JS代码以灵活的方式操作请求/响应
API说明
function onRequest(context, request)
在请求到达服务器之前,调用此函数,您可以在此处修改请求数据
具体参数格式见 > 参数定义
asyncfunctiononRequest(context,request){console.log(request.url);//URL参数
request.queries["name"]="value";//更新或添加新标头
request.headers["X-New-Headers"]="My-Value";deleterequest.headers["Key-Need-Delete"];//Update Body 使用fetch API请求接口,具体文档可网上搜索fetch API
//request.body = await fetch('https://www.baidu.com/').then(response => response.text());
//共享参数 后面onResponse时取出
context["name"]="hello";returnrequest;}