Flask更换运行环境导致400:Your browser (or proxy) sent a request that this server could not understand

同样的服务代码,同样的post请求代码,在新的容器中运行flask服务时请求失败,parser.parse_args()报400错误

400 Bad Request: The browser (or proxy) sent a request that this server could not understand

在请求代码中使用json解析又可以访问:

requests.post(url, json=json)

经过排查,发现两个容器中Werkzeug的版本不一致:2.0.1vs2.1.0,安装指定版本后正常

你可能感兴趣的:(Flask更换运行环境导致400:Your browser (or proxy) sent a request that this server could not understand)