Ability to define a custom default user-agent in config.json
まだ誰も着手していません。
評価
調査の方向性
まず、~/.config/httpie/config.json とその default_options がどのように読み込まれるかを追跡し、次に、それらのオプションがコマンドラインの URL およびヘッダーに対してどのような順序になるかを追跡します。設定されたカスタム user-agent またはデフォルトヘッダーが、コマンドラインで繰り返し指定しなくてもリクエストに適用されれば、変更は完了です。
索引モデルが issue の本文から書いたものです。
説明
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 はありません
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
httpie/cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
new
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug new
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
似ている issue
-
customer-reported
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Azure/azure-cli#34150 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
community-request
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
NVIDIA-NeMo/Curator#2464 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
WeblateOrg/translation-finder#1099 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
trezor/trezor-firmware#7997 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信