Thread:Project:Support desk/How to create a bot to add a new section in a talk page?/reply

Apparently, you shouldn't use  in

While you want a JSON response, that doesn't mean that you need to pass data to MediaWiki in JSON format!

Try using this instead, by just passing the dictionary without further encoding:

r = requests.post(url, data = request, headers=headers)

http://docs.python-requests.org/en/latest/user/quickstart/#more-complicated-post-requests