Skip to content

Set Default Header #1660

Open
Open

Description

@sheena-antikode

Is it possible to set a default header? For example, I want every request to automatically include Content-Type: application/json.

Activity

  1. added
    new
    on Sep 15, 2025
  2. pejfat08-rgb commented on Dec 2, 2025

    @pejfat08-rgb
    • Ugh I
  3. Marias03 commented on Apr 21, 2026

    @Marias03

    Hi! I'd like to work on this feature and submit a PR. Is this still open for contribution?

  4. sheena-antikode commented on Apr 21, 2026

    @sheena-antikode
    Author

    yes please it'll help me a lot

  5. sobhardwaj commented on Jun 4, 2026

    @sobhardwaj

    Hi!, Is this still open?

  6. sobhardwaj commented on Jun 4, 2026

    @sobhardwaj

    @Marias03 is that you completed ??

  7. Marias03 commented on Jun 7, 2026

    @Marias03

    @sobhardwaj Yes, the feature is complete on my side, and both of the tests I added pass on the CI runners:

    tests/test_config.py::test_default_headers PASSED
    tests/test_config.py::test_default_headers_overridable PASSED
    

    The failing checks are unrelated to this PR:

    • Ubuntu jobs fail at the setup step because the matrix still includes Python 3.7, which is EOL and no longer available on the ubuntu-latest (24.04) runners:
      Error: The version '3.7' with architecture 'x64' was not found for Ubuntu 24.04.
      
    • Windows jobs fail only on the big5 charset-detection tests in tests/test_encoding.py (test_terminal_output_response_charset_detection[big5-...] and test_terminal_output_request_charset_detection[big5-...]), which depend on charset_normalizer behavior and are unrelated to the config/header changes here.

    So these failures affect the repo's CI in general, not this PR specifically. The fix would be on the workflow side (dropping 3.7 / pinning the runner). Happy to open a separate PR for the CI if that's useful. Let me know how you'd like to proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    new

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions