Signalling authentication failure in a RESTful API

Typically, you’d send a 401 if the client can authenticate and solve the problem, but since you don’t provide a way to authenticate in the API, I’d suggest returning a 403 error (forbidden) instead. This won’t require the header and will indicate to the client that it is unable to access the service.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)