工具 - 重写 - 重定向
参考 https://reqable.com/zh-CN/docs/capture/rewrite#redirect
微信小程序抓包
登录的时候选择127.0.0.1:9000 打开Reqable ,比如韭圈儿小程序的数据
通过脚本修改返回值
# API Docs: https://reqable.com/docs/capture/addons
from reqable import *
def onRequest(context, request):
# Print url to console
# print('request url ' + context.url)
# Update or add a query parameter
# request.queries['foo'] = 'bar'
# Update or add a http header
# request.headers['foo'] = 'bar'
# Replace http body with a text
# request.body = 'Hello World'
# Map with a local file
# request.body.file('~/Desktop/body.json')
# Convert to dict if the body is a JSON
# request.body.jsonify()
# Update the JSON content
# request.body['foo'] = 'bar'
# Done
return request
def onResponse(context, response):
# 将响应体字典化
response.body.jsonify()
# 修改字典中的version值
response.body['listProviders'][0]['disabled'] = False
# Update status code
# response.code = 404
# APIs are same as `onRequest`
print(response.body)
# Done
return response
修改header https://github.com/didierfred/SimpleModifyHeaders
评论
使用 GitHub 账号登录后即可评论