flask_restful
from flask_restful import (Resource, reqparse) # 参数解析对象生成 parser = reqparse.RequestParser() parser.add_argument("username", type=str, required=True) parser.add_argument("password", required=True) parser.add_argument("cpuCount", type=int, required=True) parser.add_argument("memorySize", type=int, required=True) parser.add_argument("diskSize", type=int, required=True) args = parser.parse_args() print args #{'username': 'zhaok', 'diskSize': 1000, 'cpuCount': 2, 'password': u'123456789', 'memorySize': 512}