1

I have a flask route app.add_url_rule("/<string:name>",'welcome',DataProcessor.welcome) what I want is to make the name parameter optional. How can I do it inside the add_url_rule method?

0

1 Answer 1

0

app.add_url_rule() does exactly the same as the @app.route() decorator. Therefore, this answer might help you out.

In short, it's not possible without setting default values to those parameters.

You can either use that approach, or use the request.args.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.