I've built some custom routes using the Wordpress REST API (native), and would like to use HAL to reduce the number of server requests.
- Does HAL do this (is my premise correct)?
My current header Content-Type is "application/json". Further, when using the &_embed parameter on the default routes, the Content-Type remains "application/json".
- Does this mean that the HAL structuring is ineffective?
- Does the Content-Type need to be application/json+hal to make a difference?
- If necessary, how do I change the Content-Type?
This document – HAL - Hypertext Application Language – claims:
HAL has a media type for both the JSON and XML variants, whos names are application/hal+json and application/hal+xml respectively.
When serving HAL over HTTP, the Content-Type of the response should contain the relevant media type name.
I'm not sure how to interpret this information.
Where can I find good information on testing whether HAL is making a difference?