2xx success 3xx redirect 4xx client erroe 5xx service error
Error
Data
When created => return new resource Data requested => send data in data element Error => return error
Matt Stauffer pg 311
Laravel 5.2 + API Token Authentication
- add api_token to users table
- new users now need this field str_random(60)
- use the
auth:api
middleware around routes - use
auth()->guard('api')->user()
Guzzle
$client = $client = new Client('https://api.github.com');
$response = $client->get("users/$username")->send();