Skip to content

Add headers arg to urljson#675

Merged
jph00 merged 3 commits into
AnswerDotAI:mainfrom
CarloLepelaars:main
Apr 1, 2025
Merged

Add headers arg to urljson#675
jph00 merged 3 commits into
AnswerDotAI:mainfrom
CarloLepelaars:main

Conversation

@CarloLepelaars
Copy link
Copy Markdown
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
Copy Markdown
Contributor

jph00 commented Mar 29, 2025

Thank you! :)

@jph00 jph00 merged commit 084c537 into AnswerDotAI:main Apr 1, 2025
@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