* @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 )
| 316 | * @returns {Promise} A promise to the results of the HTTP request |
| 317 | */ |
| 318 | function _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 |
nothing calls this directly
no test coverage detected