httpResource: Allow parse to access headers
- Dominant language
- TypeScript
- Stars
- 101k
- Forks
- 27.5k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 288
Description
### Which @angular/* package(s) are relevant/related to the feature request?
common
### Description
I have the situation where the server sends additional information in der headers, eg count information for a list. Unfortunately it seems, that `parse` cannot access the headers.
### Proposed solution
Provide access to headers as additional argument in parse:
```
{
parse: (value, headers) => [ value, headers.get('X-Count') ?? 0]
}
```
### Alternatives considered
An interceptor provided for the `HttpResourceRequest` could do the transformation as well.
Contributor guide
Research direction
Start in the common package by tracing the httpResource parse callback and the HttpResourceRequest flow to determine where response headers are available. Update the parse contract so headers can be accessed, and add coverage showing that a header such as X-Count reaches the callback and can affect the parsed result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100