PUT dictionary in dictionary in Python requests
问题 I want to send a PUT request with the following data structure: { body : { version: integer, file_id: string }} Here is the client code: def check_id(): id = request.form['id'] res = logic.is_id_valid(id) file_uuid = request.form['file_id'] url = 'http://localhost:8050/firmwares' r = requests.put(url = url, data = {'body' : {'version': id, 'file_id': str(file_uuid)}}) Here is the server code: api.add_resource(resources.FirmwareNewVerUpload, '/firmwares') class FirmwareNewVerUpload(rest