C
C
carbolka2022-03-31 14:19:42
Python
carbolka, 2022-03-31 14:19:42

Response via flask?

Hello, is it possible to execute such code at all?

@app.route('/multiplicators',methods = ['GET'])
def get_multiplicator():
tiker = request.args.get('tiker')
country = request.args.get('country')
names = request .args.get('names')
return jsonify(parse_multiplicators(tiker,country,names))

I'm trying to pass parameters to my function in the query string so that it will work and give me a json response, but I get a missing 3 required positional error arguments: 'tiker', 'country', and 'names'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ramis, 2022-03-31
@carbolka

http://localhost:5000/multiplicators/1/hello/3

@app.route('/multiplicators/<names>/<tiker>/<country>', methods = ['GET'])
def get_multiplicator(names, tiker, country):
    return jsonify(names, tiker, country)
    #return jsonify(parse_multiplicators(tiker,country,names))

[
"1",
"hello",
"3"
]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question