[Vuejs]-(Laravel 5.6, vue) Axios 401 error with PUT,POST,PATCH on Safari

0👍

Ok so apparently objects with a string property are ignored in Safari, so the authorization element in the header was never passed, hence the 401 error.

Doesn’t work

let headers={
 "Authorization":"abcdef...."
}

Works

let headers={
 Authorization:"abcdef...."
}

Also be careful about trailing slashes in axios’s url.

Leave a comment