Currently I have
@app.route("/api/job/<job_id>")
def handle_request(job_id):
print(job_id)
While when the request url is '/api/job/456?id=123'
job_id becomes 456?id=123. Is there a way I can get the job_id as 456 and exclude the args part?
Currently I have
@app.route("/api/job/<job_id>")
def handle_request(job_id):
print(job_id)
While when the request url is '/api/job/456?id=123'
job_id becomes 456?id=123. Is there a way I can get the job_id as 456 and exclude the args part?
Use request.args to get parsed contents of query string:
from flask import request
@app.route(...)
def handle_request():
id = request.args.get('id')