Banco do Brasil, second booty ticket: can not send POST to https://www63.bb.com.br/portalbb/boleto/boletos/hc21e,802,3322,10343.bbx [closed]

-3

I need to implement a web query on the second BB ticket path, from the

asked by anonymous 02.05.2018 / 20:12

1 answer

1

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.

    
02.05.2018 / 20:20