Skip to content

Add headers arg to urljson #675

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

Merged
merged 3 commits into from
Apr 1, 2025
Merged

Add headers arg to urljson #675

merged 3 commits into from
Apr 1, 2025

Conversation

CarloLepelaars
Copy link
Contributor

@CarloLepelaars CarloLepelaars commented Mar 29, 2025

Hi @jph00, I love the simplicity of urljson and use it often, but unfortunately it doesn't support headers.

Currently we can achieve the same behavior with urlread:

urlread("https://example.com", headers={"API_KEY": key}, return_json=True)

but with the proposed change it becomes slightly more elegant

urljson("https://example.com", headers={"API_KEY": key})

@jph00
Copy link
Contributor

jph00 commented Mar 29, 2025

Thank you! :)

@jph00 jph00 merged commit 084c537 into AnswerDotAI:main Apr 1, 2025
14 checks passed
@jph00 jph00 added the enhancement New feature or request label Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants