ArtisanTinkerer.github.io

Blog

View on GitHub

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

  1. add api_token to users table
  2. new users now need this field str_random(60)
  3. use the auth:api middleware around routes
  4. use auth()->guard('api')->user()

Guzzle

$client = $client = new Client('https://api.github.com');
$response = $client->get("users/$username")->send();