Skip to content
jirojo2 edited this page Sep 6, 2015 · 1 revision

Laravel API Requests

For Laravel API requests to work properly with JSON calls, three headers are needed:

X-Requested-With: XMLHttpRequest
X-CSRF-Token: <token>
Content-Type: application/json

The CSRF Token may be supplied within the body with the _token field.
The CSRF Token is attached to the session, and can be obtained in /api/v1/csrf-token

{
  "token": <token>
}
Clone this wiki locally