I need to fetch data from remote host using codes below.
$url = 'https://domain.com/cgi-bin/cgi.exe';
$data = array('email' => $email, 'password' => $password);
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded
",
'method' => 'POST',
'content' => http_build_query($data),
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
It works fine on internal network, but not on external network. Firewall has been opened for both port 80 and 443, but still doesn't work. Is there anything else that I miss?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…