Suggestion 1:
Using CORS(Cross Orignin resource sharing)
During the preflight request,
you should see the following two headers:
These request headers are asking the server for permissions to make the actual request.
Your preflight response needs to acknowledge these headers in order for the actual request to work.
For example, suppose the browser makes a request with the following headers:
Origin: http://yourdomain.com
Access-Control-Request-Method: POST
Access-Control-Request-Headers: X-Custom-Header
Your server should then respond with the following headers:
Access-Control-Allow-Origin: http://yourdomain.com
Access-Control-Allow-Methods: GET, POST
Access-Control-Allow-Headers:
X-Custom-Header
Reference
Suggestion 2:
Using JSON-P and Intermediate page:
- create a intermediate page which makes http request to https page and return JSON-P result
- If the intermediate page is in same domain then use it directly else make cross domain ajax request and use JSON-P
Reference