Sunny Kumar
Sunny Kumar

Reputation: 544

Laravel Basic Auth- Invalid Credentials Error in json

I am using basic auth in my api. When I enter a wrong credential, it throws

UnauthorizedHttpException.

I want this in JSON format.

enter image description here

Upvotes: 0

Views: 463

Answers (1)

Oguz Topcu
Oguz Topcu

Reputation: 36

You should add header "Accept: application/json" before sending your request.

Upvotes: 2

Related Questions