Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49185

Ionic Deployed on the Web: CORS Issue

$
0
0

@m52go wrote:

I copied and pasted the code from my www directory to my server and it runs beautifully. Only issue is POST requests...Chrome says:

Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://web.canonofman.com' is therefore not allowed access.

GET requests work fine. My server sends these headers out on every response:

        defaultHeaders: {
            'Access-Control-Allow-Origin': '*',
            'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept',
            'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
            'Content-Type': 'application/json'
        }

Any ideas how I can get POST requests to work?

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49185

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>