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

Function _httpPut

lib/http-transport.js:318–327  ·  view source on GitHub ↗

* @method put * @async * @param {WPRequest} wpreq A WPRequest query object * @param {Object} data The data for the PUT request * @param {Function} [callback] A callback to invoke with the results of the PUT request * @returns {Promise} A promise to the results of the HTTP request

( wpreq, data, callback )

Source from the content-addressed store, hash-verified

316 * @returns {Promise} A promise to the results of the HTTP request
317 */
318function _httpPut( wpreq, data, callback ) {
319 checkMethodSupport( 'put', wpreq );
320 const url = wpreq.toString();
321 data = data || {};
322
323 let request = _auth( agent.put( url ), wpreq._options, true ).send( data );
324 request = _setHeaders( request, wpreq._options );
325
326 return invokeAndPromisify( request, callback, returnBody.bind( null, wpreq ) );
327}
328
329/**
330 * @method delete

Callers

nothing calls this directly

Calls 3

_authFunction · 0.85
_setHeadersFunction · 0.85
invokeAndPromisifyFunction · 0.85

Tested by

no test coverage detected