valhallasw/flask-mwoauth — pull request #2 by CristianCantoro (2014-01-09 17:07:22+00:00)
Title: Yet another change to 'next' parameter and handling of big requests

This pull request introduces two changes:
1. the next parameter in oauth-callback is pop-ed from the dictionary with the safe fallback of the default url, instead of `try: ... except KeyError: ...` (sorry about the continuous but this solution looks even cleaner to me)
2. as documented in the [API:Edit](https://www.mediawiki.org/wiki/API:Edit#Large_texts) page of MediaWiki, large requests should be sent as `multipart/form-data;` POST requests. I have used the (awesome) requests module to create those (thus adding a dependency). Encoding (to utf-8) of parameters is done only for text, summary and title this should be enough for the most common queries using `action=query` or `action=edit` but should be checked if there are other parameters needing utf-8 encoding (or maybe a more general approach could be used).

Thanks to @rshk for the guidance and the tips about requests.