Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 KB | None | 0 0
  1.         $client = new \GuzzleHttp\Client();
  2.         $jar = new \GuzzleHttp\Cookie\CookieJar();
  3.         $res = $client->request('POST', 'https://auth-ac.my.com/auth', [
  4.             'headers' => [
  5.                 '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',
  6.                 'Origin' => 'https://account.my.com/login/',
  7.                 'Referer' => 'https://account.my.com/login/'
  8.             ],
  9.             'form_params' => [
  10.                 'email' => 'test@test.ru',
  11.                 'password' => 'password',
  12.                 'nosavelogin' => 1,
  13.                 'continue' => 'https://target.my.com/auth/mycom?state=target_login%3D1',
  14.                 'failure' => 'https://account.my.com/login/'
  15.             ],
  16.             ['cookies' => $jar]
  17.         ]);
  18.         //echo $res->getStatusCode();
  19.         echo $res->getBody();
  20.  
  21.         $url = "https://target.my.com/ads/";
  22.         $res = $client->get($url, [
  23.             ['cookies' => $jar]
  24.         ]);
  25.         dd($res->getBody());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement