MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / sendPatchRequest

Method sendPatchRequest

lib/helper/REST.js:377–391  ·  view source on GitHub ↗

* 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 = {})

Source from the content-addressed store, hash-verified

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.

Callers 1

REST_test.jsFile · 0.80

Calls 2

_urlMethod · 0.95
_executeRequestMethod · 0.95

Tested by

no test coverage detected