php - cross domain rest api post put get delete -
i built rest api get, post, put, delete angularjs single page application . client wants host rest api in separate domain , angularjs single page application in domain. here @ development both angularjs application , rest api in same domain if move rest api domain calls rest api angularjs application comes under cross domain requests, tried jsonp call requests requests working , post, put, delete requests not working.
how solve problem make post, put, delete requests rest api in different domain.
if have access modify rest api try add code @ top.
header('access-control-allow-origin: *'); header('access-control-allow-methods: get, post');
you change "*" angularjs application's domain name. hope you.
Comments
Post a Comment