Update naming for header methods on requests
See original GitHub issueThe putHeaders/withHeaders methods are confusing for multiple people.
Let’s deprecate them and add addHeaders
and replaceHeaders
methods respectively. Those names have immediately-obvious semantics.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
HTTP headers - MDN Web Docs - Mozilla
Request headers contain more information about the resource to be fetched, or about the client requesting the resource. · Response headers hold ...
Read more >Custom HTTP headers : naming conventions - Stack Overflow
The recommendation is was to start their name with "X-". E.g. X-Forwarded-For , X-Requested-With . This is also mentioned in a.o. section 5 ......
Read more >Specifying HTTP headers - IBM
To specify the content types of the request body and output, use the Content-Type and Accept headers. Table 1. Content-Type and Accept header...
Read more >HTTP/1.1: Header Field Definitions
The Accept request-header field can be used to specify certain media types which are acceptable for the response. Accept headers can be used...
Read more >HTTP Request Methods – Get vs Put vs Post Explained with ...
Select the PATCH request method. 3. In the Headers tab, set accept as a header and set the value to application/vnd.github.v3+json .
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
There are a lot of ways to do this, so let’s try to be a bit more rigorous in our definitions.
Accept
), and some are singletons (e.g.,Content-Length
). A recurring header can have multiple instances. A singleton header only sensibly has one.Set-Cookie
, because our forebears hated us and wanted us to be unhappy.I’m going to intentionally avoid our existing names for things here, because I can’t remember what the damn things do. But there are several possible implementations of
(a: Headers, b: Headers) => Headers
. Which ones do we want, and what should they be called?a
tob
, regardless of semantics.a
andb
, joining duplicates with a comma, regardless of semantics.a
withb
. Append recurring headers fromb
tob
. Keep other headers froma
.a
withb
. Combine recurring headers by key ina
andb
. Keep other headers froma
.a
withb
. Keep other headers froma
.b
I’m not aware of any active effort to change them from 0.23. Is there something you’d still like to see?