Hi @nagesh, in order to provide you with a complete answer, we'll need some extra information. For instance, we'll need a code snippet, what you expect the snippet to do and the full error message in question. Please see our Guide to Asking Questions for more detail.
Hi thanks for the response <br>am trying to run the below code from front end with out using any backend server<br>getting CORS issue <br><br>
var data = null; var xhr = new XMLHttpRequest(); xhr.addEventListener("readystatechange", function () { if (this.readyState === this.DONE) { console.log(this.responseText); } }); xhr.open("GET", "https://apisandbox.dev.clover.com/v3/merchants/9C0G0TBK9QJRY?access_token=REDACTED"); xhr.setRequestHeader("accept", "application/json"); xhr.send(data);
Did you check this URL using e.g. Postman or curl? Does it work? (they do not implement the same origin policy like browsers). BTW: you should not post sensitive data like access tokens in this forum
Yes I tried in Postman and it works. You are right..shouldnt be posting sensitive token data..apologies. Coming back to original question, how or what should I do to invoke clover api directly from UI without getting CORS issue. Please help! Thanks in Advance!!
Waiting for your response!
2 People are following this question.