A
A
AlmazKayum2020-11-26 16:18:20
Flask
AlmazKayum, 2020-11-26 16:18:20

How to get all options in Flask?

Can't get all options.

@app.route('/api/some_method', methods=['GET'])
def some_method():
    return jsonify(request.args)

CURL only outputs date1.
http://IP:PORT/api/some_method?date1=1603715699&date2=1606159439

{
"date1": "1603715699"
}
What am I stupid about? Tell me plz.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-11-26
@AlmazKayum

Where do you get this, at what request?
Most likely, the URL was not enclosed in quotes, the ampersand is not perceived as text, but as a console argument

curl "http://127.0.0.1:5000/api/some_method?date1=1603715699&date2=1606159439"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question