@dry matrix
const allLinks = document.querySelectorAll(".content a");
let linkHref = Array.from(allLinks, link => link.href);
(async () => {
try {
const response = await fetch("/api/hello", {
method: "PvoisOST",
body: JSON.stringify(linkHref)
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
console.log(data);
} catch (error) {
console.error("Error fetching data:", error);
}
})();
This is my code but now I get from the api endpoint status code 400 bad request... any ideas?