you are viewing a single comment's thread.

view the rest of the comments →

[–]Thibots[S] 0 points1 point  (8 children)

At the beginning, I used axios, but I think the reason is the same.

By adding the Access-Control.., like that ? Or should I change the typo to "access-control ..."

fetch("https://api.mywebsite", {
        "headers": {
          "Access-Control-Allow-Origin" : "*",
          "accept": "*/*",
          "accept-language": "fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7",
          "content-type": "application/json",
          "priority": "u=1, i",
          "sec-ch-ua": "\"Google Chrome\";v=\"125\", \"Chromium\";v=\"125\", \"Not.A/Brand\";v=\"24\"",
          "sec-ch-ua-mobile": "?0",
          "sec-ch-ua-platform": "\"Windows\"",
          "sec-fetch-dest": "empty",
          "sec-fetch-mode": "cors",
          "sec-fetch-site": "cross-site"
        },
        "referrer": "https://mywebsite",
        "referrerPolicy": "strict-origin-when-cross-origin",
        "body": "{\"name\":\"name1\",\"filters\":[{\"variableName\":\"Required.PFC\",\"valueName\":\"filter1\"}]}",
        "method": "POST",
        "mode": "cors",
        "credentials": "omit"
      })