moodle-web-service-client
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

moodle-web-service-client

Package to format service request in Moodle web service format

Table of Contents

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command:

$ npm install moodle-web-service-client

Debug errors Information

To activate debug options.

Go to moodle -> site administration -> developer -> debugging

In debugging messages select developer options.

Examples

General Use

If you want to use the default method (POST) you can use the following example.

import {moodleClient} from "moodle-web-service-client";
 const response = await moodleClient({
  urlRequest: {
    rootURL: 'http://localhost/moodle',
    token: 'aeb315e6dd3affc18352fe46124cdd48',
    webServiceFunction: 'core_course_get_courses',
  },
  content: {
   options: {
    ids: [1, 2, 3],
   },
  },
 });

General Use with another methods

If you want to use another methods like POST, PUT, DELETE, PATCH, etc. You can use the method property.

import {moodleClient} from "moodle-web-service-client";
 const response = await moodleClient({
  urlRequest: {
    rootURL: 'http://localhost/moodle',
    token: 'aeb315e6dd3affc18352fe46124cdd48',
    webServiceFunction: 'core_course_get_courses',
  },
  content: {
   options: {
    ids: [1, 2, 3],
   },
  },
  method: 'GET',
 });

Docs

Read The Docs

Issues

Looking to contribute? Look for the label.

🐛 Bugs

Please file an issue for bugs, missing documentation, or unexpected behavior.

See Bugs

💡 Feature Requests

Please file an issue to suggest new features. Vote on feature requests by adding a 👍. This helps maintainers prioritize what to work on.

See Feature Requests

Contributors

Hector L. Arrechea
Hector L. Arrechea

💻 📖 🚇 ⚠️

LICENSE

MIT

Package Sidebar

Install

npm i moodle-web-service-client

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

34.3 kB

Total Files

27

Last publish

Collaborators

  • hector21