I'm quite new of using API and here.
I'm facing CORS prob.
Error is below .
Access to XMLHttpRequest at 'https://api-us.faceplusplus.com/facepp/v3/detect?api_key={0}&api_secret={1}&image_url={2}&return_attributes={3}'
from origin 'http://localhost:3111' has been blocked by CORS policy:
Response to preflight request doesn't pass access control check:
No 'Access-Control-Allow-Origin' header is present on the requested resource
;
And here is my code
async submit(){
let imgSrc = document.getElementById("photo").src
const self = this
try{
let headers = {headers:{"Access-Control-Allow-Origin":"*",}}
console.log(headers)
let response = await self.$axios.$post(CONSTANTS.API_URL,self.createParam(imgSrc),headers)
console.log(response)
}catch(error){
console.log(error)
}
},
I could check this API works properly at Restlet Client on Google Chrome.
this is screen shot on Restlet Client
Help me somebody.