pallets-eco / flask-jwt

JWT (JSON Web Tokens) for Flask applications
MIT License
564 stars 177 forks source link

AttributeError: 'NoneType' object has no attribute 'get' #58

Closed mayantigo closed 9 years ago

mayantigo commented 9 years ago

Hi!.

Im running exactly the example of GitHub. When I try get the token the log tell me this:

File "C:\Python34\lib\site-packages\flask_jwtinit.py", line 114, in _def ult_auth_request_handler username = data.get(current_app.config.get('JWT_AUTH_USERNAME_KEY'), None) AttributeError: 'NoneType' object has no attribute 'get'

Im checking the code and I see nothing Is exactly the same code of the example.

Any suggestion?.

mattupstate commented 9 years ago

You are most likely sending an incorrect HTTP request to your server. Make sure the Content-Type header is set to a JSON content type like application/json and make sure the request body is a JSON formatted string. However, we should add a check to see that JSON data was sent to the server in the _defult_auth_request_handler function.

mayantigo commented 9 years ago

That is exactly what is happening.

Thank you very much!.

xcixor commented 7 years ago

has to be JSON(application/json)

Poovendranavs commented 5 years ago

can anyone guide me how to build Bulk upload request and get output in Postman.

Vishal1309 commented 2 years ago

@mayantigo do you remember how exactly did you deal with this error? I cannot figure out the solution here