Skip to content

Commit

Permalink
[DPLT-1044] Pass required JSON content type header (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
morgsmccauley committed Jun 29, 2023
1 parent d4db522 commit bbf8ccf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions indexer-js-queue-handler/latest-post-metrics-writer.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import fetch from "node-fetch";
import AWS from "aws-sdk";

import Metrics from './metrics.js'
import Metrics from "./metrics.js";

export const handler = async () => {
const metrics = new Metrics("QueryAPI");

const response = await fetch("https://api.near.social/index", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
action: "post",
key: "main",
Expand All @@ -21,7 +24,7 @@ export const handler = async () => {
const body = await response.text();

if (response.status !== 200) {
throw new Error(body);
throw new Error(body);
}

const [{ blockHeight }] = JSON.parse(body);
Expand Down

0 comments on commit bbf8ccf

Please sign in to comment.