Guest User

Untitled

a guest
Mar 6th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. $username = $form_state['input']['name'];
  2. $password = $form_state['input']['pass'];
  3.  
  4. $authurl = variable_get('sgauth_base_url_authenticate', '');
  5. $headers = array('Content-Type' => 'application/json');
  6. $data = array('email' => $username, 'password' => $password);
  7. $query = drupal_http_build_query($data);
  8. $options = array('headers' => $headers, 'method' => 'POST', 'data' => $query);
  9. $result = drupal_http_request($authurl, $options);
  10.  
  11. dpm($result);
  12.  
  13. POST /SingPostApi/MobileAuthenticate HTTP/1.0
  14. Content-Type: application/json
  15. User-Agent: Drupal (+http://drupal.org/)
  16. Host: xxxxxxxxxxxx.xxxxxxxxxx.com
  17. Content-Length: 36
  18.  
  19. email=xxx%40xx.xxx&password=xxxxxxxx
  20.  
  21. drupal_json_encode($input);
  22.  
  23. header('Content-Type: application/json');
  24. echo drupal_json_decode($output);
Add Comment
Please, Sign In to add comment