Show HN: Content Negotiation in PHP – API Without API (Symfony, Laravel, Temma) (old.reddit.com)

3 points by amaury_bouchard ↗ HN
I'm preparing a talk on APIs for AFUP Day, the French PHP conference. One of the topics I'll cover is content negotiation: making your website serve both HTML and JSON from the same endpoints, depending on what the client requests via the Accept header. This avoids building and maintaining a separate API alongside your website. The post shows the same example implemented in Symfony, Laravel and Temma, from explicit conditional code to a fully declarative approach.

0 comments

[ 1.9 ms ] story [ 10.6 ms ] thread

No comments yet.