MCPcopy
hub / github.com/vercel/next.js / fetch

Method fetch

test/lib/next-modes/base.ts:920–931  ·  view source on GitHub ↗

* Performs a fetch request to the NextInstance with the options provided. * * @param pathname the pathname on the NextInstance to fetch * @param opts the optional options to pass to the underlying fetch * @returns the fetch response

(
    pathname: string,
    opts?: import('node-fetch').RequestInit
  )

Source from the content-addressed store, hash-verified

918 * @returns the fetch response
919 */
920 public async fetch(
921 pathname: string,
922 opts?: import('node-fetch').RequestInit
923 ) {
924 try {
925 this.throwIfUnavailable()
926 } catch (error) {
927 Error.captureStackTrace(error, this.fetch)
928 throw error
929 }
930 return fetchViaHTTP(this.url, pathname, null, opts)
931 }
932
933 public on(event: Event, cb: (...args: any[]) => any) {
934 if (!this.events[event]) {

Calls 2

throwIfUnavailableMethod · 0.95
fetchViaHTTPFunction · 0.90

Tested by 15

revalidatePathFunction · 0.36
revalidatePathFunction · 0.36
fetchWithPolicyFunction · 0.36
fetchForTestFunction · 0.36
runTestsFunction · 0.36
verifyReactExportsFunction · 0.36
runTestsFunction · 0.36
collectCssFunction · 0.36
fetchRscResponseFunction · 0.36
fetchSplitHTMLFunction · 0.36
getLastModifiedTimeFunction · 0.36
fetchSitemapFunction · 0.36