* Sends PUT request to API. * * ```js * I.sendPutRequest('/api/users.json', { "email": "user@user.com" }); * * // To mask the payload in logs * I.sendPutRequest('/api/users.json', secret({ "email": "user@user.com" })); * * ``` * * @param {string} url * @param {*} [pa
(url, payload = {}, headers = {})
| 408 | * @returns {Promise<*>} response |
| 409 | */ |
| 410 | async sendPutRequest(url, payload = {}, headers = {}) { |
| 411 | const request = { |
| 412 | baseURL: this._url(url), |
| 413 | method: 'PUT', |
| 414 | data: payload, |
| 415 | headers, |
| 416 | } |
| 417 | |
| 418 | if (this.options.maxContentLength) { |
| 419 | request.maxContentLength = this.options.maxContentLength |
| 420 | request.maxBodyLength = this.options.maxBodyLength |
| 421 | } |
| 422 | |
| 423 | return this._executeRequest(request) |
| 424 | } |
| 425 | |
| 426 | /** |
| 427 | * Sends DELETE request to API. |
no test coverage detected