Revision: 6663 Author: russblau Date: 2009-04-22 12:37:19 +0000 (Wed, 22 Apr 2009)
Log Message: ----------- Use http POST method for all API queries; may be helpful to users in certain countries, and long GET URLs could cause occasional problems
Modified Paths: -------------- branches/rewrite/pywikibot/data/api.py
Modified: branches/rewrite/pywikibot/data/api.py =================================================================== --- branches/rewrite/pywikibot/data/api.py 2009-04-22 11:25:22 UTC (rev 6662) +++ branches/rewrite/pywikibot/data/api.py 2009-04-22 12:37:19 UTC (rev 6663) @@ -184,15 +184,10 @@ self.site.throttle(write=write) uri = self.site.scriptpath() + "/api.php" try: - if write or action in ("login", "expandtemplates", "parse"): - # add other actions that require POST requests above - rawdata = http.request(self.site, uri, method="POST", - headers={'Content-Type': - 'application/x-www-form-urlencoded'}, - body=params) - else: - uri = uri + "?" + params - rawdata = http.request(self.site, uri) + rawdata = http.request(self.site, uri, method="POST", + headers={'Content-Type': + 'application/x-www-form-urlencoded'}, + body=params) except Exception, e: #TODO: what exceptions can occur here? pywikibot.output(traceback.format_exc(), level=pywikibot.ERROR)
pywikipedia-svn@lists.wikimedia.org