I need to implement a web query on the second BB ticket path, from the
I need to implement a web query on the second BB ticket path, from the
This probably indicates that there was an HTTP redirect of code 302:
This document you requested has moved temporarily.
How do I respond to:
You should use CURLOPT_FOLLOWLOCATION
, example:
$urlPost = '<site>';
$post_fields = array(
.... //items do formulário
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $urlPost);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); //passa o user-agent atual para o curl
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
Of course this will not solve every problem, even more so if they use an anti-bot, or an anti-CSRF, which there is no practical solution to circumvent.