I am trying to send data to a couchdb database using POST request with python requests library. But there is a problem, when I execute the script this error appears : {"error":"bad_request","reason":"invalid UTF-8 JSON"} And here is the code :
>>> import requests
>>> import json
>>> import couchdb
>>> url = 'http://admin:pass@localhost:5984/db_reviewin'
>>> headers = {'Content-type':'application/json'}
>>> payload = {"key":"value"}
>>> res = requests.post(url, headers=headers,data=payload)
>>> print(res.text)
If you have any idea, tell me ! Thanks and have a good day/night