form-data Content-Type doesn't seem to permit setting charset for individual content fields [rt.cpan.org #69078]
まだ誰も着手していません。
評価
調査の方向性
HTTP::Request::Common の POST から始め、form-data フィールドがどのように表現され、その Content-Type がどのように出力されるかを追跡します。既存のファイルアップロード用 workaround と、要求されているファイルではないフォームフィールドの動作を比較します。完了の条件は、フィールドが明示的な charset を持て、それでもファイルアップロードとして扱われないことです。提案された構文とエンコードされた値もカバレッジに含めます。
索引モデルが issue の本文から書いたものです。
説明
Migrated from rt.cpan.org#69078 (status was 'new')
Requestors:
From [email protected] on 2011-06-24 14:46:50:
Although the HTML 4.01 spec and the HTTP 1.1 spec refer to being able to set the
charset for individual form-data encoded controls, POST in HTTP::Request::Common
doesn't seem to have any way of specifying the charset per field.
In particular, the content field might have wide characters that I want to encode
and transmit.
POST $url, Content => [ surname => encode('utf8',"JÄdrejek"), b64_data => $base64_string
], Content_Type => 'form-data';
The receiving doesn't know what encoding was used for surname in the case above.
Perhaps the following syntax instead?
Content => [ surname => { Content => $encoded_string, Content_Type=> 'text/plain;
charset='utf8' }, b64_data => $base64_string ]
Regrettably I've no patch to offer. Perhaps there is a way to achieve this currently, but I didn't
work it out.
From [email protected] on 2011-06-24 15:01:14:
Reading more carefully, there is actually a work-around that is very much like the suggested
syntax.
{ surname => [undef,"t1.txt",Content=>encode("utf8","JÄdrejek"),Content_Type=>"text/plain;
charset=utf8"] }
On Fri Jun 24 10:46:50 2011, [email protected] wrote:
> Although the HTML 4.01 spec and the HTTP 1.1 spec refer to being able
> to set the
> charset for individual form-data encoded controls, POST in
> HTTP::Request::Common
> doesn't seem to have any way of specifying the charset per field.
>
> In particular, the content field might have wide characters that I
> want to encode
> and transmit.
>
> POST $url, Content => [ surname => encode('utf8',"JÄdrejek"), b64_data
> => $base64_string
> ], Content_Type => 'form-data';
>
> The receiving doesn't know what encoding was used for surname in the
> case above.
>
> Perhaps the following syntax instead?
>
> Content => [ surname => { Content => $encoded_string, Content_Type=>
> 'text/plain;
> charset='utf8' }, b64_data => $base64_string ]
>
> Regrettably I've no patch to offer. Perhaps there is a way to achieve
> this currently, but I didn't
> work it out.
From [email protected] on 2011-06-24 15:21:52:
that form means the server treats those as file uploads rather than parameters though.
On Fri Jun 24 11:01:14 2011, [email protected] wrote:
> Reading more carefully, there is actually a work-around that is very
> much like the suggested
> syntax.
>
> { surname =>
> [undef,"t1.txt",Content=>encode("utf8","JÄdrejek"),Content_Type=>"text/plain;
> charset=utf8"] }
>
>
> On Fri Jun 24 10:46:50 2011, [email protected] wrote:
> > Although the HTML 4.01 spec and the HTTP 1.1 spec refer to being
> able
> > to set the
> > charset for individual form-data encoded controls, POST in
> > HTTP::Request::Common
> > doesn't seem to have any way of specifying the charset per field.
> >
> > In particular, the content field might have wide characters that I
> > want to encode
> > and transmit.
> >
> > POST $url, Content => [ surname => encode('utf8',"JÄdrejek"),
> b64_data
> > => $base64_string
> > ], Content_Type => 'form-data';
> >
> > The receiving doesn't know what encoding was used for surname in the
> > case above.
> >
> > Perhaps the following syntax instead?
> >
> > Content => [ surname => { Content => $encoded_string, Content_Type=>
> > 'text/plain;
> > charset='utf8' }, b64_data => $base64_string ]
> >
> > Regrettably I've no patch to offer. Perhaps there is a way to
> achieve
> > this currently, but I didn't
> > work it out.
>
>
- 主要言語
- Perl
- スター
- 32
- フォーク
- 62
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
libwww-perl/HTTP-Message のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
libwww-perl/HTTP-Message#228 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
libwww-perl/HTTP-Message#227 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
libwww-perl/HTTP-Message#216 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
libwww-perl/HTTP-Message#207 · コメント 1 件 ·
-
Decoding of deflate content-encoding doesn't respect max_body_size対応中かも @simbabque が 539 日前に担当しました。 オープン
libwww-perl/HTTP-Message#206 · コメント 1 件 · 担当者 1 名 ·
libwww-perl/HTTP-Message の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
LMS-Community/slimserver#1692 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
fix(api): API v3 Product Read ignores request language (lc) for sample products and image URLs対応中かも @muntasir-396 が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
openfoodfacts/openfoodfacts-server#15042 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信