form-data Content-Type doesn't seem to permit setting charset for individual content fields [rt.cpan.org #69078]
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia con POST in HTTP::Request::Common e segui come vengono rappresentati i campi form-data e come vengono emessi i relativi tipi di contenuto. Confronta il workaround esistente per il caricamento di file con il comportamento richiesto per i campi del modulo che non sono file; il lavoro è completato quando un campo può avere un charset esplicito senza essere trattato come un caricamento di file, con copertura per la sintassi proposta e il valore codificato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
>
>
- Lingua principale
- Perl
- Stelle
- 32
- Fork
- 62
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di libwww-perl/HTTP-Message
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
libwww-perl/HTTP-Message#228 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
libwww-perl/HTTP-Message#227 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
libwww-perl/HTTP-Message#216 ·
-
Please add a security policyAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
libwww-perl/HTTP-Message#207 · 1 commento ·
-
Decoding of deflate content-encoding doesn't respect max_body_sizeForse già presa @simbabque l’ha presa 539 giorni fa. Aperta
libwww-perl/HTTP-Message#206 · 1 commento · 1 assegnatario ·
Tutte le issue di libwww-perl/HTTP-Message
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
LMS-Community/slimserver#1692 · 6 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
fix(api): API v3 Product Read ignores request language (lc) for sample products and image URLsForse già presa @muntasir-396 l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
openfoodfacts/openfoodfacts-server#15042 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno