Respon with status: 0 for URL: null

我们两清 提交于 2020-01-07 05:01:27

问题


im using ionic view legacy and the http post don't have any problem about it. but when migrating using ionic view pro when doing http post then show error "Respon with status: 0 for URL: null".

This is a part of my config.xml

    <access origin="*" subdomain="true" />
    <allow-navigation href="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
   
    <plugin name="ionic-plugin-keyboard" spec="~2.2.1" />
    <plugin name="cordova-plugin-statusbar" spec="2.2.2" />
    <plugin name="cordova-plugin-device" spec="1.1.4" />
    <plugin name="cordova-plugin-splashscreen" spec="~4.0.1" />
    <plugin name="cordova-plugin-ionic" spec="^1.1.9">
        <variable name="APP_ID" value="-" />
        <variable name="CHANNEL_NAME" value="Master" />
        <variable name="UPDATE_METHOD" value="auto" />
    </plugin>
    <plugin name="cordova-plugin-whitelist" spec="^1.3.1" />

this problem because of CORS so at back end i just add :

/* Allow from any origin */
		if (isset($_SERVER['HTTP_ORIGIN'])) {
			header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
			header('Access-Control-Allow-Credentials: true');
			header('Access-Control-Max-Age: 86400');
		}

but problem still not solved.


回答1:


Finally… i solve this problem with change from http to https and check header send. Headher from jwt is my problem, so i change it using post not header.



来源:https://stackoverflow.com/questions/46397111/respon-with-status-0-for-url-null

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!