Bogdan Pirozhok2017-09-17 18:28:04
Bogdan Pirozhok, 2017-09-17 18:28:04

AJAX POST to third party server in Apache Cordova?

Good evening! Faced a problem. I make a cross domain post request from a mobile application. The whole thing ends in error. The error indicates that the request could not be completed. In the config, I allowed all domains, just in case, I added the one to which I send the request. I've added a meta tag just in case.

<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: http://dia.kvitka.club 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">

The file on the server to which I am addressing says: That is, problems with the cross-domain request itself are excluded + through the simulation of the application in the browser and through the emulator, the request passes. The error occurs already directly on the devices and only there. Please tell me where is the catch, why mobile phones do not want to skip ajax requests?
header("Access-Control-Allow-Origin: *");

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question