ue http 请求学习笔记

目录

插件名:

http_server.py

ue中设置请求例子:


插件名:

DTHttpRequest.zip

http_server.py

python 复制代码
from flask import Flask, request, jsonify
from datetime import datetime

app = Flask(__name__)

@app.before_request
def log_request():
    print(
        f"[{datetime.now()}] "
        f"{request.remote_addr} "
        f"{request.method} "
        f"{request.path}"
    )
    if request.data:
        print("Body:", request.data.decode("utf-8"))

@app.route("/", methods=["GET"])
def hello():
    return jsonify(status="ok", msg="hello world")

@app.route("/echo", methods=["POST"])
def echo():
    data = request.get_json(silent=True)
    return jsonify(status="ok", received=data)

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=7999)

ue中设置请求例子:

相关推荐
不可能的是6 小时前
前端 SSE 流式请求三种实现方案全解析
前端·http
Jony_2 天前
高可用移动网络连接
网络协议
chilix2 天前
Linux 跨网段路由转发配置
网络协议
DianSan_ERP4 天前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
呉師傅4 天前
火狐浏览器报错配置文件缺失如何解决#操作技巧#
运维·网络·windows·电脑
gihigo19984 天前
基于TCP协议实现视频采集与通信
网络协议·tcp/ip·音视频
2501_946205524 天前
晶圆机器人双臂怎么选型?适配2-12寸晶圆的末端效应器有哪些?
服务器·网络·机器人
linux kernel4 天前
第七部分:高级IO
服务器·网络
数字护盾(和中)4 天前
BAS+ATT&CK:企业主动防御的黄金组合
服务器·网络·数据库
~远在太平洋~4 天前
Debian系统如何删除多余的kernel
linux·网络·debian