Sending a request via curl to an HTTPS URL is not that difficult in terms of PHP code.
Something like this should work fine (I just tried this piece of code on my machine, Windows, PHP 5.3):
$url = 'https://.../...'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch); echo $data;
And it outputs the result perfectly: the same thing that I get in my browser when I try to access the https:// URL; with the exception of CSS, of course.
You can take a look at the curl_setopt : there are many options, and some of them may be useful in your particular case curl_setopt
Here I used CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST ; Iām not sure that you will need those who have Amazon, but I had to use them, otherwise this part of the code did not work, but this may be due to the fact that the certificate that I use is by itself ... Try with with them and without them, and you will quickly find out if you need them.
Pascal martin
source share