Solve cors problem using rest api or ajax

Solve cors problem using rest api or ajax