我正在尝试编写Flask API的语句验证代码,并且想检查key的值是否为int,但似乎Postman表单数据中存储的值是字符串类型。有什么方法可以将值存储为原始类型?
Here is my code:
if type(request.form['user_id']) is not int and (request.form['passport_url']) is not str:
abort(make_response(jsonify(Error="UserId or PassportUrl type is not valid", Code="500"), 500))