Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- curl 'https://XXXXXXXX/login' -H 'Authorization: Basic XXXXXXXX=='
- -H 'Content-Type: application/x-www-form-urlencoded'
- --data 'username=XXXXXXXX&password=XXXXXXXX'
- class XXXXXX {
- function login($username='', $password='') {
- // construct url - returns https://XXXXXXXX/login
- $url = $this->constructLoginUrl();
- $data = array(
- 'username' => $username,
- 'password' => $password
- );
- $headers = array(
- 'Authorization' => "Basic XXXXXXXX==",
- 'Content-Type' => "application/x-www-form-urlencoded"
- );
- $response = drupal_http_request( $url, $headers, 'POST', http_build_query( $data )
- return $response;
- }
- }
- drupal_http_request($url, array(
- 'headers' => $headers,
- 'method' => 'POST',
- 'data' => http_build_query($data)
- ));
Add Comment
Please, Sign In to add comment