dolanor / rip

REST in peace
BSD 3-Clause "New" or "Revised" License
68 stars 0 forks source link

Remove file type extension in URL that allows for content negociation #12

Closed dolanor closed 6 months ago

dolanor commented 7 months ago

if you curl localhost:8888/users/1.xml you can get XML without passing an Accept header.

But reading more about RESTful design, I learned it goes against the URI definition, because /users/1 would be considered different from /users/1.xml.

It makes sense to me, and it was more of a gimmick to play in the browser anyway. It will simplify the code and remove some ugly hacks and dependencies on hardcoded mime types.

ref: https://restfulapi.net/content-negotiation/#comment-1099

dolmen commented 7 months ago

Also: file extension support imposes restrictions on entities identifiers.