MCPcopy Index your code
hub / github.com/WP-API/node-wpapi / _httpDelete

Function _httpDelete

lib/http-transport.js:337–348  ·  view source on GitHub ↗

* @method delete * @async * @param {WPRequest} wpreq A WPRequest query object * @param {Object} [data] Data to send along with the DELETE request * @param {Function} [callback] A callback to invoke with the results of the DELETE request * @returns {Promise} A promise to the results of the HTTP

( wpreq, data, callback )

Source from the content-addressed store, hash-verified

335 * @returns {Promise} A promise to the results of the HTTP request
336 */
337function _httpDelete( wpreq, data, callback ) {
338 if ( ! callback && typeof data === 'function' ) {
339 callback = data;
340 data = null;
341 }
342 checkMethodSupport( 'delete', wpreq );
343 const url = wpreq.toString();
344 let request = _auth( agent.del( url ), wpreq._options, true ).send( data );
345 request = _setHeaders( request, wpreq._options );
346
347 return invokeAndPromisify( request, callback, returnBody.bind( null, wpreq ) );
348}
349
350/**
351 * @method head

Callers

nothing calls this directly

Calls 3

_authFunction · 0.85
_setHeadersFunction · 0.85
invokeAndPromisifyFunction · 0.85

Tested by

no test coverage detected