From 6426286d75ab1debb54d380e876a70dcad1dcf66 Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Sun, 17 May 2026 13:21:00 +0800 Subject: api/blogs should be POST --- www/scripts/blog.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'www/scripts') diff --git a/www/scripts/blog.js b/www/scripts/blog.js index f49c5ca..0e8fa2f 100644 --- a/www/scripts/blog.js +++ b/www/scripts/blog.js @@ -4,7 +4,12 @@ const clamp = (val, min, max) => Math.min(Math.max(val, min), max) const api_url = "https://altafcreator.com" function postList(n = 0) { - fetch(`${api_url}/api/blogs/`) + fetch(`${api_url}/api/blogs/`, { + method: "POST", + headers: { + "Content-Type": "application/json", + } + }) .then((response) => response.json()) .then((data) => { n = clamp(n, 0, data.posts.length); -- cgit v1.2.3