Guest User

Untitled

a guest
May 25th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. $client = new Client([
  2. 'verify' => false
  3. ]);
  4. try {
  5. $res = $client->post(
  6. $base_uri . $uri, [
  7. 'headers' => [
  8. 'content-type' => 'application/json',
  9. 'authorization' => $login['token'],
  10. ],
  11. 'form_params' => []
  12. ]
  13. );
  14. echo 'OK';
  15. return json_decode($res->getBody(), true);
  16. } catch (GuzzleHttpExceptionClientException $e) {
  17. echo 'ClientException';
  18. } catch (Exception $exc) {
  19. echo 'Exception';
  20. }
Add Comment
Please, Sign In to add comment