Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $username = $form_state['input']['name'];
- $password = $form_state['input']['pass'];
- $authurl = variable_get('sgauth_base_url_authenticate', '');
- $headers = array('Content-Type' => 'application/json');
- $data = array('email' => $username, 'password' => $password);
- $query = drupal_http_build_query($data);
- $options = array('headers' => $headers, 'method' => 'POST', 'data' => $query);
- $result = drupal_http_request($authurl, $options);
- dpm($result);
- POST /SingPostApi/MobileAuthenticate HTTP/1.0
- Content-Type: application/json
- User-Agent: Drupal (+http://drupal.org/)
- Host: xxxxxxxxxxxx.xxxxxxxxxx.com
- Content-Length: 36
- email=xxx%40xx.xxx&password=xxxxxxxx
- drupal_json_encode($input);
- header('Content-Type: application/json');
- echo drupal_json_decode($output);
Add Comment
Please, Sign In to add comment