Comments (3)
An updated version of the api.py patch : https://gist.github.com/nberger-git/77f1d8091987eaa19c53
This has a fix to avoid 503 errors in GET mode, provided by @cariaso.
from wikitools.
What's the motivation for using GET instead of POST in some cases? I'm not sure the additional code complexity is worth the benefit.
from wikitools.
There are 2 major benefits.
#1. Server performance. GET operations can be cached with Varnish and
similar tools, POST cannot. My site has dramatically more bot traffic than
humans, and this makes a big difference.
This is consistent with RFC1945
https://tools.ietf.org/html/rfc1945#section-8 which explicitly states
Applications must not cache responses to a POST request because the
application has no way of knowing that the server would return an
equivalent response on some future request.
See also http://stackoverflow.com/a/3477374
#2. Logging/Diagnostics. GET params are easily visible in a standard log
184.1.2.3 - - [09/Jun/2016:01:08:31 +0000] "GET
/api.php?inprop=protection%7Csubjectid&format=json&rvprop=content%7Cids%7Cflags%7Ctimestamp%7Cuser%7Ccomment%7Csize&rawcontinue=1&prop=revisions%7Cinfo&titles=Rs62033400&rvlimit=1&action=query
HTTP/1.1" 200 642 "-" "MediaWiki::Gateway/1.1.0"
is much more useful than
113.1.2.3 - - [08/Jun/2016:02:21:28 +0000] "POST /api.php HTTP/1.1" 200 917
"-" "python-wikitools/1.4"
For apache, getting these sorts of details from a POST requires installing
additional modules, and is discouraged except during brief, targeted
debugging.
https://httpd.apache.org/docs/current/mod/mod_dumpio.html
One possible implementation is at
And I would be happy to make a pull request, or any requested changes.
On Jun 9, 2016 9:21 AM, "MZMcBride" [email protected] wrote:
What's the motivation for using GET instead of POST in some cases? I'm not
sure the additional code complexity is worth the benefit.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#31 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAHpkkmYrsSXP0p5-nSUD96tvIM6GbqSks5qJ1yMgaJpZM4GBDqs
.
from wikitools.
Related Issues (20)
- COPYING missing HOT 3
- very high lag time: possible causes? HOT 2
- Problem connecting with https-site HOT 2
- Cant delete pages HOT 2
- How to fix "The supplied MD5 hash was incorrect" error? HOT 4
- Upload file size limit is 100 MB HOT 1
- Allow finer control of API errors in client code. HOT 2
- Does this package support Python 3?
- using wikitools with MediaWiki in localhost HOT 1
- Port this to python3 HOT 2
- 403 Client Error
- py 3 page.py
- Py3 branch can not be installed with setuptools (dependency_links, install_requires), only through requirements.txt, due to version overload HOT 3
- How to iterate over each one item in category?
- import wikitools ImportError: No module named wikitools
- wikitools.wiki.Wiki for biografias.bcn.cl: Invalid JSON HOT 1
- Fall back from queryGen() to query() on versions with querycontinue only
- is project completely deprecated now ?
- Deprecated API calls
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wikitools.