I'm getting a response from a server, which returns a response which has a message. But I can't figure out how to convert the message to json
I tried just converting it like this
.then((response) => {
return response.message.json();
})
But that didn't work
This is my current code
fetch(`http://127.0.0.1:80/grab`, {
method: "post",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
token: token,
key: "grab_links",
index: 10
}),
})
.then((response) => {
return response.json();
})
.then((data) => {
console.log(data)
const linksHTML = data
});
So how would I do this?