python - Flask框架如何直接获取POST请求的JSON原始数据?
阿神
阿神 2017-04-17 17:14:02
0
2
311

自己做了个小网站接了第三方服务,第三方服务会POST一个JSON过来参与签名加密,我必须获取第三方POST过来的JOSN的原始数据才能正确效验。

现在是用Flask的request.get_json()去拿JSON数据,拿是可以拿到,但是拿到的数据已经不是原始数据了,被重新排序,键值对还加了空格,这样就不是原始的JSON了,加密效验也就无法完成。

请求大神指点如何拿到原始的JSON数据。当然,要基于Flask 的route。

阿神
阿神

闭关修行中......

répondre à tous(2)
刘奇
> request.data

Contains the incoming request data as string in case it came with a mimetype Flask does not handle.

PHPzhong

request.get_data()

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!