返回文章列表
104 字 · 1 分钟

Reqable将https请求转发到本地

· 编辑文章

工具 - 重写 - 重定向

Image

参考 https://reqable.com/zh-CN/docs/capture/rewrite#redirect

微信小程序抓包

登录的时候选择127.0.0.1:9000 打开Reqable ,比如韭圈儿小程序的数据

Image

通过脚本修改返回值

# 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

Image

评论

无需注册,填写昵称即可评论 阅读 — 次