Skip to content

feat: add default_timeout support to config#1832

Open
Marias03 wants to merge 3 commits intohttpie:masterfrom
Marias03:feature/default-timeout
Open

feat: add default_timeout support to config#1832
Marias03 wants to merge 3 commits intohttpie:masterfrom
Marias03:feature/default-timeout

Conversation

@Marias03
Copy link
Copy Markdown

What does this PR do?

Adds support for default_timeout in HTTPie's config file.
Users can now set a global timeout that applies to all requests automatically.

How to use it?

Add to your config.json:

{
    "default_timeout": 30
}

This timeout will apply to all requests unless overridden with --timeout.

Changes

  • httpie/config.py: Added default_timeout to Config.DEFAULTS and a new property
  • httpie/client.py: Applied default_timeout from config in make_send_kwargs
  • tests/test_config.py: Added two tests for the new feature

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

Successfully merging this pull request may close these issues.

1 participant