What problem are you trying to solve?
Right now there are two main ways to attach arbitrary data to a HTTP response
- a custom HTTP Header
- a Cookie
However, we can neither access the current page header via javascript nor read the cookies from a fetch response. That means when we build the logic for the server, if I want to send an arbritary data outside of the body of the response and intend to use it in a per Request Basis, It is very awkward to do so.
And even though the cookie from a fetch response via document.cookie but if there are many fetch request happening in a page it would either face race conditions or unneccessarily populate cookie names for each fetch site and/or request
Therefore, We should have a unified way to send some data apart from the body of the response that can be read by both the page request and the fetch request.
What solutions exist today?
Right now, the backend logic would have to seperate the fetch request from the normal page request, and choose to send the data in the corresponding format.
- Cookie for a normal request
- Header for a fetch request
OR
Send both at the same time.
How would you solve it?
Either expose HTTP Header to Javascript runtime or expose response cookies to fetch API
Anything else?
No response
What problem are you trying to solve?
Right now there are two main ways to attach arbitrary data to a HTTP response
However, we can neither access the current page header via javascript nor read the cookies from a fetch response. That means when we build the logic for the server, if I want to send an arbritary data outside of the body of the response and intend to use it in a per Request Basis, It is very awkward to do so.
And even though the cookie from a fetch response via document.cookie but if there are many fetch request happening in a page it would either face race conditions or unneccessarily populate cookie names for each fetch site and/or request
Therefore, We should have a unified way to send some data apart from the body of the response that can be read by both the page request and the fetch request.
What solutions exist today?
Right now, the backend logic would have to seperate the fetch request from the normal page request, and choose to send the data in the corresponding format.
OR
Send both at the same time.
How would you solve it?
Either expose HTTP Header to Javascript runtime or expose response cookies to fetch API
Anything else?
No response