* Sends PATCH request to API. * * ```js * I.sendPatchRequest('/api/users.json', { "email": "user@user.com" }); * * // To mask the payload in logs * I.sendPatchRequest('/api/users.json', secret({ "email": "user@user.com" })); * * ``` * * @param {string} url * @param {
(url, payload = {}, headers = {})
| 375 | * @returns {Promise<*>} response |
| 376 | */ |
| 377 | async sendPatchRequest(url, payload = {}, headers = {}) { |
| 378 | const request = { |
| 379 | baseURL: this._url(url), |
| 380 | method: 'PATCH', |
| 381 | data: payload, |
| 382 | headers, |
| 383 | } |
| 384 | |
| 385 | if (this.options.maxContentLength) { |
| 386 | request.maxContentLength = this.options.maxContentLength |
| 387 | request.maxBodyLength = this.options.maxBodyLength |
| 388 | } |
| 389 | |
| 390 | return this._executeRequest(request) |
| 391 | } |
| 392 | |
| 393 | /** |
| 394 | * Sends PUT request to API. |
no test coverage detected