Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $client = new \GuzzleHttp\Client();
- $jar = new \GuzzleHttp\Cookie\CookieJar();
- $res = $client->request('POST', 'https://auth-ac.my.com/auth', [
- 'headers' => [
- 'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36',
- 'Origin' => 'https://account.my.com/login/',
- 'Referer' => 'https://account.my.com/login/'
- ],
- 'form_params' => [
- 'email' => 'test@test.ru',
- 'password' => 'password',
- 'nosavelogin' => 1,
- 'continue' => 'https://target.my.com/auth/mycom?state=target_login%3D1',
- 'failure' => 'https://account.my.com/login/'
- ],
- ['cookies' => $jar]
- ]);
- //echo $res->getStatusCode();
- echo $res->getBody();
- $url = "https://target.my.com/ads/";
- $res = $client->get($url, [
- ['cookies' => $jar]
- ]);
- dd($res->getBody());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement