Changing the post to
response=self.app.post('/test_function',
data=json.dumps(dict(foo='bar')),
content_type="application/json")
fixed it.
Thanks to user3012759.
More Related Contents:
- How to return a dict as a JSON response from a Flask view?
- How to get POSTed JSON in Flask?
- json.dumps vs flask.jsonify
- TypeError: ObjectId(”) is not JSON serializable
- Return JSON response from Flask view
- Flask jsonify a list of objects
- Cast Flask form value to int
- Python Flask, TypeError: ‘dict’ object is not callable
- Converting Flask form data to JSON only gets first value
- Keep a datetime.date in ‘yyyy-mm-dd’ format when using Flask’s jsonify
- Are a WSGI server and HTTP server required to serve a Flask app?
- Sending data from HTML form to a Python script in Flask
- Link to Flask static files with url_for
- Store large data or a service connection per Flask session
- Why am I seeing “TypeError: string indices must be integers”?
- jsonify a SQLAlchemy result set in Flask [duplicate]
- Flask to return image stored in database
- String to Dictionary in Python [duplicate]
- How to compare two JSON objects with the same elements in a different order equal?
- How to load all entries in an infinite scroll at once to parse the HTML in python
- Preserving global state in a flask application [duplicate]
- How to iterate through a list of dictionaries in Jinja template?
- ImportError: No module named MySQLdb
- flask blueprint template folder
- Flask App: Update progress bar while function runs
- Get inserted key before commit session
- How can I parse (read) and use JSON in Python?
- How to change json encoding behaviour for serializable python object?
- Insert multiple documents in Elasticsearch – bulk doc formatter
- flask socketio emit to specific user