| Package Data | |
|---|---|
| Maintainer Username: | eNathan |
| Maintainer Contact: | enathan.x@gmail.com (eNathan) |
| Package Create Date: | 2015-02-16 |
| Package Last Update: | 2015-02-18 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-03 15:11:10 |
| Package Statistics | |
|---|---|
| Total Downloads: | 2,600 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 2 |
| Total Watchers: | 1 |
| Total Forks: | 2 |
| Total Open Issues: | 0 |
Simple HTTP rest client for Laravel by eNathan
Add the following to your composer.json's dependency list:
"require": {
"enathan/laravel-http-rest-client"
}
In the root directory of your Laravel project (where composer.json is located), run:
composer update
Open config/app.php and add the following line to the providers array:
$providers => [
... ,
'App\Providers\LaravelHttpRestClient'
];
The RestClient is a singleton registered in Laravel's IoC as HttpRestClient. You can access the rest client by using \App::make('HttpRestClient').
$RestClient = \App::make('HttpRestClient');
$response = $RestClient->get('http://my_rest_server.com/',
array(
'username': 'foo',
'password': 'bar
)
);