0

I have these two methods, while in the getall connector it does not require any parameter from the URL so its working fine. But when I'm trying the same for delete connector it is giving me error:

user_delete_connector() got an unexpected keyword argument 'id'

Help me out! To solve the specific problem

@app.route('/users/getall')
@auth.token_auth()
def user_getall_connector():
    return obj.user_getall_model()

#Delelte Request Method
@app.route('/users/delete/<id>', methods=['DELETE'])
@auth.token_auth()
def user_delete_connector(id):
    return obj.user_delete_model(id)
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • I think you need to define the route correctly like this: `@app.route('/users/delete/', methods=['DELETE'])` – Akif Hussain Aug 29 '23 at 10:28
  • Does this answer your question? [How to delete items from database using a Flask framework?](https://stackoverflow.com/questions/25925024/how-to-delete-items-from-database-using-a-flask-framework) – Akif Hussain Aug 29 '23 at 10:38

0 Answers0