Developing the Javascript Client: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
(Created page with "== Some quick hints == === Ajax calls === * We are using the axios library for ajax calls: https://github.com/axios/axios * We have our own wrapper around it: https://github.c...")
 
 
Line 2: Line 2:
=== Ajax calls ===
=== Ajax calls ===
* We are using the axios library for ajax calls: https://github.com/axios/axios
* We are using the axios library for ajax calls: https://github.com/axios/axios
* We have our own wrapper around it: https://github.com/openpetra/openpetra-client-js/blob/master/src/lib/ajax.js#L30
* We have our own wrapper around it: https://github.com/openpetra/openpetra/blob/master/js-client/src/lib/ajax.js#L31
* We make calls to the API, as it is available here: https://demo.openpetra.org/api/
* We make calls to the API, as it is available here: https://demo.openpetra.org/api/
* We want the result formatted as JSON. This only works with post, not with get, and with at least an empty list of parameters. Otherwise you get the result formatted in XML.
* We want the result formatted as JSON. This only works with post, not with get, and with at least an empty list of parameters. Otherwise you get the result formatted in XML.

Latest revision as of 20:38, 11 May 2022

Some quick hints

Ajax calls

Example:

api.post('serverMSysMan.asmx/TMaintenanceWebConnector_LoadUsersAndModulePermissions', {})
       .then(function(response) {
       ...