plesk-api-client
v1.0.3
Published
Plesk XML-RPC API Client
Downloads
88
Readme
Plesk XML-RPC API Client for Node.js
Installation
npm install --save plesk-api-client
Usage
Basic usage:
const pleskApi = require('plesk-api-client');
...
request =
`<packet>
<server>
<get_protos/>
</server>
</packet>`;
...
const client = new pleskApi.Client(host);
client.setCredentials(login, password);
client.request(request, (response) => {
...
});
Usage with promise:
...
client.request(request)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.log(error);
});
Usage with self-signed certificates on 8443 port:
process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0;
...
client.request(...