Untitled

 avatar
unknown
plain_text
3 years ago
683 B
5
Indexable

$cookies = new \GuzzleHttp\Cookie\CookieJar();

$client = Http::withOptions(['cookies' => $cookies]);

$body = $client->get('https://www.kbpatrimoine.com/', [
    'email' => 'jh@haussmania.com',
    'password' => 'Preemo26+',
])->body();

$matches = [];
preg_match('/<meta name="csrf-token" content="(.+)">/', $body, $matches);

$token = $matches[1];

$client->asForm()->post('https://www.kbpatrimoine.com/login', [
    '_token' => $token,
    'email' => 'jh@haussmania.com',
    'password' => 'Preemo26+',
]);

dd($client->get('https://www.kbpatrimoine.com/i-api/prospects/prescriber')->json());

dd($client->get('https://www.kbpatrimoine.com/programme-immobilier/71481')->body());
Editor is loading...