Objective:
The introduction, guidance, and examples of Python flask abound on the web. Refer to this website: http://www.pythondoc.com/flask/index.html
You may not know the Flask service: Once done a project:
A + a-server
Objective:
Provide testing or development data for commissioning/testing
Brief introduction:
A: Generate legal/illegal (traversal/non-traversal) data according to the JSONSCHEMA definition
A-server: Implements the interface, obtains the JSONSCHEMA definition in the server, passes to the a project package for processing
Highlights A-server:
1@app. Route ('/jsonschema/r/<traversal>', methods=["POST"])2 defLegal_random (traversal=False):3 #by judging the value of the passed-in traversal parameter, select whether to traverse4 ifTraversal = = 1orTraversal = ="1":5Traversal =True6 Else:7Traversal =False8 9data = {}#The data here is the definition of Jsonschema.Ten OneClient = A.client ()#calling an interface for a project ALegal_value = client.random (data, traversal=traversal) - - returnMake_response (Jsonify (Legal_value))
Execution Results View:
Execute the appropriate debug code Python xxx.py can be
View directly in the browser: HTTP://IP: Port/JSONSCHEMA/R/1
The flask of Python services