JavaScript encountered a cross-domain error using the fetch post method

I use the following code to make a cross-domain request for the post method:

let formData= new FormData();
      for (var attr in data) {//datajson
          formData.append(attr,data[attr]);
      }
fetch(url,{
            method:method,
            mode:"cors",
            headers:{
                "Content-Type": "application/json",
                "Cross-Method": "CORS",
            },
            body: formData,
        }).then(function(res){
            console.log("fetchrequest",JSON.stringify(res.ok));
            if(res.ok){
                res.json().then(function(json){
                    console.info(json);
                    message.success(":"+":\r\n"+json);
                });
            }else{
                message.error(":"+"");
            }

        }).catch(function(e){
            message.error(":"+"");
        });

but the following error is displayed:

The

clipboard.png

clipboard.png
post parameter and the custom header I wrote have no hint at all.
returns a hint of Invalid CORS request
. I don"t know what went wrong.

Mar.20,2021

Server programs should set headers that allow cross-domain + carry.

you have provided a custom header cross-method,content-type , if you use php :

// 
header('Access-Control-Allow-Origin: *');
// 
// Access-Control-Allow-Headers :https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Access-Control-Allow-Headers
header('Access-Control-Allow-headers: cross-method'); //  content-type 
Menu