MCPcopy Create free account
hub / github.com/Hashnode/starter-kit / constructor

Method constructor

packages/utils/renderer/services/HNRequest.ts:46–58  ·  view source on GitHub ↗

* @param url - Request url * @param opts - Object of options for fetch()

(url: string, opts: any)

Source from the content-addressed store, hash-verified

44 * @param opts - Object of options for fetch()
45 */
46 constructor(url: string, opts: any) {
47 this.url = url;
48 const { headers = {}, ...restOfTheOpts } = opts;
49 this.requestObj = {
50 method: 'GET',
51 headers: {
52 Accept: 'application/json',
53 'Content-Type': 'application/json',
54 ...headers,
55 },
56 ...restOfTheOpts,
57 };
58 }
59
60 /**
61 * @param opts - RequestOptions - Fetch's Request type

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected