You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hasattr is actually just a getattr that returns True or False based on if an AttributeError is raised. So when you do hasattr, you're still executing request.json, which is a property that executes request.get_json.
In pallets/werkzeug#2355, accessing json now raises a 400 error instead of returning None if the request is not well formed. You can use silent=True to make it return None instead, or you can use request.is_json instead to check if the request has a JSON content type before trying to decode the data.
Hi guys, yesterday i notice that getting or verifying 'json' in request object, an exception (BadRequest) raise
For getattr(request, 'json') or even hasattr(request, 'json') I got:
Someone can help me to understand? Thanks
Environment:
The text was updated successfully, but these errors were encountered: