diff --git a/src/stacks-rpc-api/smart-contracts/map-entry.ts b/src/stacks-rpc-api/smart-contracts/map-entry.ts index dfb0344..222504f 100644 --- a/src/stacks-rpc-api/smart-contracts/map-entry.ts +++ b/src/stacks-rpc-api/smart-contracts/map-entry.ts @@ -38,7 +38,10 @@ export async function mapEntry(args: Args): Promise> { }; } init.method = "POST"; - init.body = args.mapKey.startsWith("0x") ? args.mapKey : `0x${args.mapKey}`; + init.body = JSON.stringify( + args.mapKey.startsWith("0x") ? args.mapKey : `0x${args.mapKey}`, + ); + init.headers = { ...init.headers, "Content-Type": "application/json" }; const endpoint = `${args.baseUrl}/v2/map_entry/${args.contractAddress}/${args.contractName}/${args.mapName}?${search}`; const res = await fetch(endpoint, init); @@ -47,10 +50,11 @@ export async function mapEntry(args: Args): Promise> { name: "FetchMapEntryError", message: "Failed to fetch map entry.", data: { + init, status: res.status, statusText: res.statusText, endpoint, - bodyParseResult: await safePromise(res.json()), + bodyParseResult: await safePromise(res.text()), }, }); }