Best practice example Here is an example based on http://handler usage. 1. Open the Provisioning section and start creating a handler. - Specify the name, type, and status.
- In the Event field, select the Clients Create event from the drop-down list.
- In the Task field, indicate http:// type and determine the port and method, for example: , 120.0.0.1:5000/api.
- Click Apply.
Find an example of the http:// handler below: Code Block |
---|
| from flask import Flask, request
import json
app = Flask(__name__)
@app.route("/api", methods=['GET', 'POST'])
def api():
data = json.loads(request.data)
return json.dumps(data)
if __name__ == "__main__":
app.run() |
|