CORS and phonegap apps

后端 未结 4 1616
走了就别回头了
走了就别回头了 2020-11-28 11:10

Do phonegap applications require any CORS changes (like setting Access-Control-Allow-Origin:*) to work? I have a restful API hosted on Heroku and was wondering whether I nee

4条回答
  •  我在风中等你
    2020-11-28 11:36

    Yes You have to activate CORS on he server that hosts your API. I am running a Phonegap App on iOs. My app requests json from a server API on Apache. I activate CORS on the server to get the data otherwise I get nothing in my application, no error and no data.

    Notice that the access parameter in the config file lets you filter which domain your application is authorized to query but does nothing with the server's permissions.

提交回复
热议问题