voip:cisco7940-7960
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| voip:cisco7940-7960 [11/06/2025 19:18] – [Useful Link] andrew | voip:cisco7940-7960 [12/06/2025 15:14] (current) – [Cisco XML Services] andrew | ||
|---|---|---|---|
| Line 212: | Line 212: | ||
| [[https:// | [[https:// | ||
| + | |||
| + | Flask based code to generate XML:- | ||
| + | |||
| + | <code python> | ||
| + | from flask import Flask, request, render_template, | ||
| + | |||
| + | |||
| + | app = Flask(__name__) | ||
| + | |||
| + | |||
| + | # See https:// | ||
| + | |||
| + | @app.route('/ | ||
| + | def xml_response(): | ||
| + | # Define sample data to be returned as XML | ||
| + | data0 = { | ||
| + | ' | ||
| + | ' | ||
| + | } | ||
| + | |||
| + | data1 = { | ||
| + | ' | ||
| + | ' | ||
| + | } | ||
| + | |||
| + | # Convert data to XML format | ||
| + | xml_data = f""" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | """ | ||
| + | |||
| + | # Create a response with the XML content type | ||
| + | response = Response(xml_data, | ||
| + | return response | ||
| + | |||
| + | |||
| + | @app.route('/ | ||
| + | def xml_opt0_response(): | ||
| + | # Define sample data to be returned as XML | ||
| + | data0 = { | ||
| + | ' | ||
| + | ' | ||
| + | } | ||
| + | |||
| + | # Convert data to XML format | ||
| + | xml_opt0_data = f""" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | """ | ||
| + | |||
| + | # Create a response with the XML content type | ||
| + | response = Response(xml_opt0_data, | ||
| + | return response | ||
| + | </ | ||
| Line 219: | Line 293: | ||
| [[https:// | [[https:// | ||
| + | [[https:// | ||
| ---- | ---- | ||
voip/cisco7940-7960.1749669506.txt.gz · Last modified: by andrew
