<div id="app">
<div>
<h1>@helia/verified-fetch Example</h1>
<h2>Custom Accept Header</h2>
<p id="output" class="output"></p>
</div>
</div>
import { verifiedFetch } from "https://esm.sh/@helia/verified-fetch?bundle-deps"
const output = document.getElementById("output")
// 👇 dag-cbor CID
const resp = await verifiedFetch( "ipfs://bafyreicnokmhmrnlp2wjhyk2haep4tqxiptwfrp2rrs7rzq7uk766chqvq", {
headers: { Accept : "application/vnd.ipld.dag-json" }
})
const obj = await resp.json()
output.innerHTML = JSON.stringify(obj, null, "\t")
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.