1.1.1 • Published 7 months ago

moodle-web-service-client v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

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

LICENSE

MIT

1.1.1

7 months ago

1.1.0

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago