Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom request headers #2050

Closed
glonlas opened this issue May 17, 2020 · 4 comments
Closed

Add custom request headers #2050

glonlas opened this issue May 17, 2020 · 4 comments
Assignees
Labels
closed-for-staleness feature-request This issue requests a feature.

Comments

@glonlas
Copy link

glonlas commented May 17, 2020

Is your feature request related to a problem? Please describe.
Botocore seems to not support custom headers yet. For some application we will need additional headers like X-Amz-Date, Accept-Encoding, Connection, and so on.

Describe the solution you'd like
I would like to propose a pull-request adding to extend JSONSerializer#serialize_to_request with the ability to receive custom headers via a Serializer attribute (Dict) we can customize. So applications using Botocore can decide what additional headers they want/need.

This will increase Botocore's flexibility.

Is there any concern about such a new feature?

@glonlas glonlas added feature-request This issue requests a feature. needs-triage This issue or PR still needs to be triaged. labels May 17, 2020
@swetashre swetashre self-assigned this May 19, 2020
@swetashre
Copy link
Contributor

@glonlas - Thank you for your post. Marking this as feature request.

Currently you can inject custom headers to an api call by registering it with boto3 events. Here is the link to the documentation with example:
https://boto3.amazonaws.com/v1/documentation/api/latest/guide/events.html

Hope it helps.

@swetashre swetashre removed the needs-triage This issue or PR still needs to be triaged. label May 19, 2020
@swetashre swetashre assigned kdaily and unassigned swetashre Mar 25, 2021
@github-actions
Copy link

Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@Frederik-Baetens
Copy link

Frederik-Baetens commented Jul 26, 2022

Hi, I'd like to have this feature request re-opened as it is indeed possible to add headers to a request, but I want to set a different header with each call, which I don't think is possible as of now with the current extensibility mechanism.

I.e. It seems to be possible to register a handler to an event, but I haven't found a way to pass extra information to this handler at runtime upon each invocation.

@mullenkamp
Copy link

Yes, this would be very useful. Unfortunately, this issue got passed off from boto/boto3#2889 (with quite a bit of interest) then died here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness feature-request This issue requests a feature.
Projects
None yet
Development

No branches or pull requests

5 participants