close

[Solved] TypeError: __init__() got an unexpected keyword argument ‘method’

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error TypeError: init() got an unexpected keyword argument ‘method’ in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How TypeError: init() got an unexpected keyword argument ‘method’ Error Occurs?

Today I get the following error TypeError: init() got an unexpected keyword argument ‘method’ in python.

How To Solve TypeError: init() got an unexpected keyword argument ‘method’ Error ?

  1. How To Solve TypeError: init() got an unexpected keyword argument 'method' Error ?

    To Solve TypeError: init() got an unexpected keyword argument 'method' Error I had encountered a similar problem in my code and just had to change the keyword “method” to “methods“:

  2. TypeError: init() got an unexpected keyword argument 'method'

    To Solve TypeError: init() got an unexpected keyword argument 'method' Error I had encountered a similar problem in my code and just had to change the keyword “method” to “methods“:

Solution 1

63

I had a similar problem. In my code I had a line  @bp.route('/<init:id>/delete', method=('POST')) The keyword method needs to be changed to methods(with an s)

Solution 2

I had encountered a similar problem in my code and just had to change the keyword “method” to “methods“:

@app.route('/login', methods = ['GET', 'POST'])

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read