Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jdennis's avatar

Postman "Preview" Of Laravel API Errors Mangled

I'm currently developing an API using Laravel. I'm using Postman while developing. I've tried using both the Postman desktop app and just through the web browser. When Laravel throws an error and I use the Postman "Preview" to view it, I can see what the error is, but the page is mangled. If I save it to an .html file and open that, it shows the error page properly. Anyone know how to get those error messages to display properly in Postman?

0 likes
4 replies
Snapey's avatar
Snapey
Best Answer
Level 122

make sure your api call has the accept: Application/json header

1 like
jdennis's avatar

Ok, thank you for your response. I was hoping to be able to fully / properly view the pretty Laravel error screen showing the line of code in the source, etc. But in hindsight, I guess that is kind of weird / probably not the intent of Postman "preview". Putting accept: application/json in the header now gets me a clean JSON response.

martinbean's avatar

@jdennis You would be better off adding actual tests to your Laravel application, instead of testing in something like Postman.

Snapey's avatar

please mark it solved if you have your answer :-)

Please or to participate in this conversation.