Ask coding questions

← Back to all posts
How to use jsonstore.io
Coder100 (172)

I need help posting data to jsonstore.io for a project I am working on.
Whenever I do this:

fetch('https://www.jsonstore.io/[id]/users/1', {
  headers: {
    'Content-type': 'application/json'
  },
  method: 'POST',
  body: { name: 'jon snow', age: 31 },
});

as shown in the documentation,
it does not work and returns this:

Access to fetch at 'https://www.jsonstore.io/cf024bb815a93131ce9fed91b1f9dafa43a3c557e9be66e66fd76df5c64f10fe/users/1' from origin 'https://repl.it' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

How do I surpass this?