Answers for "browser cors error"

1

chrome cors error localhost

//in my case i just added the 

  'content-type': 'text/plain',
  
  
in side my header it is working now

example : ========================
     {
        method: 'POST',
        headers: { 
            'content-type': 'text/plain',
           
        }
    }
Posted by: Guest on September-24-2021
0

javascript cors error

$.ajax({
            headers: { "Accept": "application/json"},
            type: 'GET',
            url: 'http://cl.ly/2wr4',
            crossDomain: true,
            beforeSend: function(xhr){
                xhr.withCredentials = true;
          },
            success: function(data, textStatus, request){
                console.log(data);
            }
 });
Posted by: Guest on May-13-2020

Browse Popular Code Answers by Language