如何在自定义Flask端点中捕获OCS Inventory-NG / Agent POST请求的可读数据

问题描述

我想使用Flask和跨平台的库存代理OCS Inventory-NG为我的本地网络构建一个小型的库存服务器。现在,我被困在试图在我的Flask终端机中充气OCS Inventory-NG发送的有效载荷。在有效负载中,似乎代理已发送加密的信息,但是我不确定。下面进一步是存储库URL 要求:

  • Python依赖项
Flask==1.1.2
Flask-Inflate==0.2
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
Werkzeug==1.0.1
from flask import Flask,request
from flask_inflate import inflate
import io
import gzip
app = Flask(__name__)

@app.route('/',methods = ['POST'])
@inflate
def possibly_gzipped_content_function():
    compressed_data = io.BytesIO(request.data)
    text_data = gzip.GzipFile(fileobj=compressed_data,mode='r')
    print(text_data)
    return

if __name__ == "__main__":
    app.debug = True
    app.run()

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)