MCPcopy Create free account
hub / github.com/api-platform/website / phpFetch

Function phpFetch

pwa/app/playground/components/SwaggerUI.tsx:41–62  ·  view source on GitHub ↗
(url: URL, opts: any = {})

Source from the content-addressed store, hash-verified

39};
40
41function phpFetch(url: URL, opts: any = {}) {
42 const spec = opts.ccall(
43 "phpw_exec",
44 STR,
45 [STR],
46 [getRequestCode(url, opts)]
47 ) as string;
48
49 if (!spec) {
50 throw new Error("PHP call did not return anything.");
51 }
52
53 const parts = spec.split("\r\n\r\n");
54 const head = parseHeaders(parts[0]) as any;
55 const body = parts[1];
56
57 return new Response(body, {
58 status: head.statusCode,
59 statusText: head.statusMessage,
60 headers: new Headers(head.headers),
61 });
62}
63
64function SwaggerUIReact(props: any) {
65 const ui = SwaggerUIConstructor(props) as any;

Callers 1

SwaggerUIFunction · 0.85

Calls 1

getRequestCodeFunction · 0.85

Tested by

no test coverage detected