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

Ability to replace all headers when passing in headers map #419

Closed
haroon-sheikh opened this issue Nov 10, 2021 · 0 comments
Closed

Ability to replace all headers when passing in headers map #419

haroon-sheikh opened this issue Nov 10, 2021 · 0 comments

Comments

@haroon-sheikh
Copy link
Contributor

haroon-sheikh commented Nov 10, 2021

**Is your feature request related to a problem?

Currently we're able to run .headerReplace() for a single header but not a map of headers.

As part of our requests, we pass in a headers map which sometimes may include the default headers but with Unirest.get(...).headers(map), it would just append to default headers. We would like to replace the default headers if the map contains it.

Describe the solution you'd like

Unirest.get("").headersReplace(headersMap); which internally calls .headerReplace(...) for each item.

I'm happy to submit a PR if you're happy with the proposed solution.

@ryber ryber closed this as completed in 863e1d1 Nov 16, 2021
ryber added a commit that referenced this issue Nov 16, 2021
Ability to replace a map of headers Fixes #419
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant