xcraft-core-utils 4.18.1 → 4.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rest.js +6 -2
- package/package.json +1 -1
package/lib/rest.js
CHANGED
|
@@ -136,11 +136,15 @@ class RestAPI {
|
|
|
136
136
|
/**
|
|
137
137
|
* @param {string} query
|
|
138
138
|
* @param {object} payload
|
|
139
|
+
* @param {object} [options]
|
|
139
140
|
* @returns {object}
|
|
140
141
|
*/
|
|
141
|
-
async _post(query, payload) {
|
|
142
|
+
async _post(query, payload, options = {}) {
|
|
142
143
|
const {got} = await import('got');
|
|
143
|
-
const result = await got.post(
|
|
144
|
+
const result = await got.post(
|
|
145
|
+
query,
|
|
146
|
+
this.#buildOptions({json: payload, ...options})
|
|
147
|
+
);
|
|
144
148
|
return result.body;
|
|
145
149
|
}
|
|
146
150
|
|