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.
if you
curl localhost:8888/users/1.xml
you can get XML without passing anAccept
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