daily pastebin goal
84%
SHARE
TWEET

Mesosfer PHP login

a guest Dec 9th, 2016 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. const tes = "yeye";
  3. echo tes;
  4.  
  5.     require dirname(__DIR__).'/../vendor/autoload.php';
  6.     const APP_ID = "secret";
  7.     const APP_KEY = "secret";
  8.     $email = $_POST['email'];
  9.     $password = $_POST['password'];
  10.  
  11.     echo APP_ID;
  12.     echo tes;
  13. try{
  14.     $client = new \GuzzleHttp\Client();
  15.  
  16.         $respAuth = $client->request('POST', 'https://api.mesosfer.com/api/v2/users/signin', [
  17.             'json'    => ['email' => $email, 'password' => $password],
  18.             'headers' => ['X-Mesosfer-AppId' => APP_ID, 'X-Mesosfer-AppKey' => APP_KEY]
  19.         ]);
  20.         $bodyAuth = (string) $respAuth->getBody();
  21.         $auth = json_decode($bodyAuth);
  22.         print_r($auth);
  23. }
  24. catch(Exception $e){
  25.     echo $e->getMessage();
  26. }
  27. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top