Skip to content

Commit

Permalink
docs(event_handler): add information about case-insensitive header lo…
Browse files Browse the repository at this point in the history
…okup function (#3183)

Co-authored-by: Leandro Damascena <[email protected]>
Co-authored-by: Heitor Lessa <[email protected]>
  • Loading branch information
3 people authored Oct 11, 2023
1 parent c190c62 commit bf2df4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aws_lambda_powertools/utilities/data_classes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def get_header_value(
default_value: str, optional
Default value if no value was found by name
case_sensitive: bool
Whether to use a case-sensitive look up
Whether to use a case-sensitive look up. By default we make a case-insensitive lookup.
Returns
-------
str, optional
Expand Down
2 changes: 1 addition & 1 deletion docs/core/event_handler/api_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ You can access the raw payload via `body` property, or if it's a JSON string you

#### Headers

Similarly to [Query strings](#query-strings-and-payload), you can access headers as dictionary via `app.current_event.headers`, or by name via `get_header_value`.
Similarly to [Query strings](#query-strings-and-payload), you can access headers as dictionary via `app.current_event.headers`, or by name via `get_header_value`. If you prefer a case-insensitive lookup of the header value, the `app.current_event.get_header_value` function automatically handles it.

```python hl_lines="19" title="Accessing HTTP Headers"
--8<-- "examples/event_handler_rest/src/accessing_request_details_headers.py"
Expand Down

0 comments on commit bf2df4f

Please sign in to comment.