docs: add tip about lower-case headers (#46)

master
Pim 2019-05-21 23:19:35 +02:00 committed by Pooya Parsa
parent 454807c5ab
commit 68d2f17ea1
2 changed files with 12 additions and 6 deletions

View File

@ -138,7 +138,7 @@ Only efficient when `proxyHeaders` is set to true. Removes unwanted request head
Globally set a header to all subsequent requests
See [here](/advanced.html#header-helpers) for usage info
See [here](/guide/advanced.html#header-helpers) for usage info
### `setToken`
@ -146,7 +146,7 @@ See [here](/advanced.html#header-helpers) for usage info
Globally set a `Authorization` header for all subsequent requests
See [here](/advanced.html#settoken-token-type) for usage info
See [here](/guide/advanced.html#settoken-token-type) for usage info
## Hooks
@ -156,13 +156,13 @@ The `arguments` listed below are those your hook will receive when it's called
- arguments: `(config)`
See [here](/advanced.html#hooks) for usage info
See [here](/guide/advanced.html#hooks) for usage info
### `onResponse`
- arguments: `(response)`
See [here](/advanced.html#hooks) for usage info
See [here](/guide/advanced.html#hooks) for usage info
### `onError`
@ -170,12 +170,12 @@ See [here](/advanced.html#hooks) for usage info
If the error originated from a request, the property `err.response` might be available
See [here](/advanced.html#hooks) for usage info
See [here](/guide/advanced.html#hooks) for usage info
## HTTP Methods
:::tip Usage
See [here](/usage.html#making-requests) for usage information for below methods
See [here](/guide/usage.html#making-requests) for usage information for below methods
:::
### `delete`

View File

@ -52,6 +52,12 @@ Globally set a header to all subsequent requests.
This method should probably not be called inside hooks as it is global and will apply to all future requests
:::
:::tip
Please note that HTTP headers are case-insensitive. Therefore all header names will be converted to lower-case to make sure that if you set the same header twice but with different casing the last one set will be used.
See also [this comment](https://github.com/sindresorhus/ky/issues/105#issuecomment-470169100) in the Ky repository for more information
:::
Parameters:
* **name**: Name of the header