Created
June 8, 2015 12:15
-
-
Save apoca/a9666ba74ef4625fcce7 to your computer and use it in GitHub Desktop.
client http apigility
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
$client = new Client([ | |
'base_uri' => 'http://esolidar-api', | |
'headers' => ['Accept' => 'application/json'], | |
]); | |
$headers = ['Content-type' => 'application/json; charset=UTF-8', 'Accept' => 'application/json']; | |
$body = json_encode(array('username' => $params['username'], 'password' => $params['password'])); | |
$request = new Request('POST', 'http://esolidar-api/users/auth', $headers, $body); | |
$response = $client->send($request, ['timeout' => 2000000]); | |
//$response = new Response(); | |
//echo "corpo: ".$response->withBody(); | |
print_r($response); | |
exit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment