Crafting absolute URLs can become a challenge when your software is deployable on-premise behind some customer specific HTTP infrastructure, e.g. SSL terminators, load balancers and in some cases web servers. Getting the original HTTPS domain used for the client facing SSL termination requires tunneling the original host through possibly many components in the upstream HTTP stack (typically in the
X-Forwarded-Host header unless the
Host header can be sent through unchanged).
For that reason, we are using root-relative in our responses, e.g. starts with /. I wouldn't mix both, though. If you choose relative, use it everywhere.
If we were providing an API at a consistent domain, we'd be using absolute URLs everywhere.