Last active
May 19, 2016 09:01
-
-
Save tareko/aaf2c14ce3b5893fceccf13daa866d08 to your computer and use it in GitHub Desktop.
HTTPSocket for login against REST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$HttpSocket = new HttpSocket(); | |
// Set data | |
$data = array( | |
'username' => 'username', | |
'password' => 'password' | |
); | |
// JSON encode data | |
$data = json_encode($data); | |
// Set request options | |
$request = array( | |
'header' => array( | |
'Connection-Type' => 'application/json' | |
) | |
); | |
$results = $HttpSocket->post('https://example.com/rest/user/login', $data, $request); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment