python endpoint example

Example 1: api in python

import requests
import json

r = requests.get("URL")
j=r.json()
print(j)

Example 2: python api tutorial

# Make a get request to get the latest position of the international space station from the opennotify api.
response = requests.get("http://api.open-notify.org/iss-now.json")
# Print the status code of the response.
print(response.status_code)

Example 3: create endpoint in python

import flask

app = flask.Flask(__name__)
app.config["DEBUG"] = True


@app.route('/', methods=['PUT'])
def home():
    return "https://prod-18.centralindia.logic.azure.com/workflows/d1dfef5cd2b54103b67a989eab024704/triggers/request/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Frequest%2Frun&sv=1.0&sig=ZRSj02or46cAlXseGsDU4VGUd6KqqXqe_U4R_W9Dxhw&Name=Masadi Srinath&[email protected]&college=Lovely Professional University&StudentId=11807750"

app.run()