Fire HTTPS requests

78 Views Asked by At

I have an android project which uses cordova. I am firing some http requests. It works fine. But when I generated signed apk, the firing is done as https requests. Android studio does not support this type of requests. How can I find an alternate solution for this? I tried Phonegap Android app ajax requests to HTTPS fail with status 0 but this answer is outdated as Cordova 4.0.0 does not have this method .Please help me out.

1

There are 1 best solutions below

0
On

@Nevin, an alternative in HTML5 is to leave out the http (or https).

Instead of this:

https://domain.com/request/

Write:

//domain.com/request/

This is support by many browsers. It is a way to fix a common problem, where the javascript is on a secure connection, but the webpage is not.