Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Ability to define a custom default user-agent in config.json

オープン
#1,568 コメント 2 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
cli

調査の方向性

まず、~/.config/httpie/config.json とその default_options がどのように読み込まれるかを追跡し、次に、それらのオプションがコマンドラインの URL およびヘッダーに対してどのような順序になるかを追跡します。設定されたカスタム user-agent またはデフォルトヘッダーが、コマンドラインで繰り返し指定しなくてもリクエストに適用されれば、変更は完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement new

Checklist

  • I've searched for similar feature requests.

Enhancement request

I propose a way to set a custom user-agent as a value to default_options in ~/.config/httpie/config.json. Or, perhaps adding a new config section named default_headers would be more logical.


Problem it solves

Including a custom user-agent on the command line adds about 130 characters to the input, which is a bit cumbersome if every httpie command requires one. It's a lot of extra text that doesn't change often that makes it hard to navigate the prompt fills up my history with super-long commands. Yuck.


Additional information

I actually tried to do this:

    "default_options": [
        "User-Agent:'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3.1 Safari/605.1.15'"
    ]

…but it doesn't work because it seems the values in default_options are applied before the URL on the command line, and the user-agent (because it's a header) must be specified after the URL. Because of this, adding a default_headers config section might be easier to implement.

主要言語
Python
スター
38.6k
フォーク
4k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

httpie/cli のほかの issue

httpie/cli の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。