As part of my GSoC project, I have developed sample code in PHP, Javascript, and MediaWiki JS to demonstrate the use of MediaWiki Action API modules. I want/seek review, valuable suggestions and feedback on the sample code format and accuracy :) I am sharing below one example each of a GET and POST request for a programming language. You can suggest your changes in a comment on this Phabricator task.
All these code samples will be shown in a tabbed window in all the API module pages on MediaWiki.org like in https://test.wikipedia.org/wiki/API:Sandbox via a Gadget that is a work in progress.
PHP
GET https://github.com/wikimedia/mediawiki-api-demos/blob/master/php/get_allpages.php
POST https://github.com/wikimedia/mediawiki-api-demos/blob/master/php/edit.php
Javascript
GET https://github.com/wikimedia/mediawiki-api-demos/blob/master/javascript/get_allpages.js
POST https://github.com/wikimedia/mediawiki-api-demos/blob/master/javascript/edit.js
MediaWiki JS
GET https://github.com/wikimedia/mediawiki-api-demos/blob/master/mediawikijs/get_allpages.js
POST https://github.com/Jayprakash-SE/mediawiki-api-demos/blob/mediawikijs-new/mediawikijs/edit.js