How do I read a response’s headers?
See original GitHub issueIs there a way to read the headers of a response, similar to the fetch(url).then(response => response.headers)
?
If not, maybe we could add this under a __headers?: {}
field on all response objects?
Huge fan of this lib, btw. I’d be happy to submit a PR for this!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Response.headers - Web APIs | MDN
The headers read-only property of the Response interface contains the Headers object associated with the response.
Read more >Reading response headers with Fetch API - Stack Overflow
In response to a cross-origin request, add 'Access-Control-Expose-Headers': '*' ...
Read more >How to read request or response headers with the HTTP Client
Use the GetHeader() and GetHeaders() methods from the response object to get a single header value or the full list of headers. This...
Read more >View Response Headers - StackPath Help
View headers with browser development tools ... Within the page, right-click (for PC users) or command-click (Mac users) to view options, and then ......
Read more >Getting Response Headers with the Javascript Fetch API
You can't directly access the headers on the response to a fetch call – you have to iterate through after using the entries()...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ferdikoomen Could you please provide a link to the spec that says that? I found this article in the OpenAPI 3.0 spec which explicitly says:
(see and/or, not either/or)
Also I found this example in the spec with both
headers
andcontent
defined in the response schema.Was there ever any update on this topic? Is it by now possible to get response header and body at once?