Link to home
Start Free TrialLog in
Avatar of ocean O
ocean OFlag for United States of America

asked on

Cross-origin resource sharing

HI, I am new to CORS. I have a question about it.
I have a js post call to web service API , but got an error in my local:
"Access to XMLHttpRequest at 'https://xyz.com/X/gettoken' from origin 'http://localhost:8080' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values 'http://localhost:8080, *', but only one is allowed. "

I see in my java code, there are some code  which add "resp.header("Access-Control-Allow-Origin", "*")". I removed it, and compiled and run, still get the same result.
Any inputs will be appreciated!
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Javascript or Java ? this is two different language...