Coder Social home page Coder Social logo

GET requests about wikitools HOT 3 OPEN

alexz-enwp avatar alexz-enwp commented on August 19, 2024
GET requests

from wikitools.

Comments (3)

nberger-git avatar nberger-git commented on August 19, 2024

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.

mzmcbride avatar mzmcbride commented on August 19, 2024

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.

cariaso avatar cariaso commented on August 19, 2024

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

cariaso@6b805c9

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.