for example the url is : http://localhost:5000/create/user/<int:id>
I want to check whether the user has passed the id parameter or not.
I have done this.
@app.route('/create/user/<int:id>')
def create_user(id=None):
if id is None:
return jsonify({'message':'Bad request'})
for example
http://localhost:5000/create/user/23
http://localhost:5000/create/user/
In the 1 url the user has provided the value of id=23 so we will procedd but in the url 2, the user has not provided any value for id parameter, so we will throw some kind of error.
I want to know, how to implement such functionality.