API talk:Edit/Editing with Python

For mediawiki version 1.19 change line to

params3 = '?format=json&action=query&prop=info&intoken=edit&titles=Main%20Page'

--

For MediaWiki 	1.25.2 PHP 	5.5.0 (cgi-fcgi) MySQL 	5.0.45

payload = {'action': 'query', 'format': 'json', 'utf8': '', 'meta': 'tokens', 'type': 'login'} r1 = requests.post(baseurl + 'api.php', data=payload) print(r1.json)
 * 1) Login request

$ python *.py {'warnings': {'tokens': {'*': "Unrecognized value for parameter 'type': login"}}, 'query': {'tokens': {}}} Traceback (most recent call last): File "import.py", line 17, in    login_token = r1.json['query']['tokens']['logintoken'] KeyError: 'logintoken'

--