Gill Bates
Gill Bates

Reputation: 15197

Different responses for requests with different mimetypes for same URL

Use case: Let's say we have www.example.org/statistics/ - with text/json it responses with JSON representation of raw data, with text/html it gives representation for human beings, with beauty, graphs, interactivity etc.

Is this good practice?

Upvotes: 0

Views: 53

Answers (1)

John Sheehan
John Sheehan

Reputation: 78132

Yes, it's called Content Negotiation and it's great way to keep your URLs nice and tidy.

Upvotes: 2

Related Questions