Answer the question
In order to leave comments, you need to log in
How to replace quotes in the received JSON in flask service?
The flask receives json somehow wrong, the application that generates json puts double quotes, and the flask changes them to single quotes. What can be done?
{'create': [{'type': 'simple', 'virtual': True, 'regular_price': '21.99', 'name': 'дрель аккумуляторная 222', 'downloadable': True}, {'type': 'simple', 'virtual': True, 'regular_price': '121.99', 'name': 'бензобур 2020', 'downloadable': True}]}
{"create": [{"type": "simple", "virtual": True, "regular_price": "21.99", "name": "дрель аккумуляторная 222", "downloadable": True}, {"type": "simple", "virtual": True, "regular_price": "121.99", "name": "бензобур 2020", "downloadable": True}]}
Answer the question
In order to leave comments, you need to log in
Flask doesn't change anything, it just deserializes json, and single quotes are string literals in python, not json.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question