Below you will find pages that utilize the taxonomy term “Header”
Posts
read more
HTTP Location Header
I came across this blog post today about using the HTTP Location Header in REST API responses when creating a resource. I have been doing Web development now since 2008 and in all that time I have never actually seen anyone use this header on any of their endpoints.
That being said it makes a lot of sense, traditionally when I would create a new resource I would return the json for that object back in the response so the caller could pull the ID out of the object, but this seems like a better way to do it, as now you could just return your 200 like normal and set this header and not have to send the response body back when the caller knows what they just sent you.