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

Function _httpGet

lib/http-transport.js:270–278  ·  view source on GitHub ↗

* @method get * @async * @param {WPRequest} wpreq A WPRequest query object * @param {Function} [callback] A callback to invoke with the results of the GET request * @returns {Promise} A promise to the results of the HTTP request

( wpreq, callback )

Source from the content-addressed store, hash-verified

268 * @returns {Promise} A promise to the results of the HTTP request
269 */
270function _httpGet( wpreq, callback ) {
271 checkMethodSupport( 'get', wpreq );
272 const url = wpreq.toString();
273
274 let request = _auth( agent.get( url ), wpreq._options );
275 request = _setHeaders( request, wpreq._options );
276
277 return invokeAndPromisify( request, callback, returnBody.bind( null, wpreq ) );
278}
279
280/**
281 * Invoke an HTTP "POST" request against the provided endpoint

Callers

nothing calls this directly

Calls 3

_authFunction · 0.85
_setHeadersFunction · 0.85
invokeAndPromisifyFunction · 0.85

Tested by

no test coverage detected