200
200
dictionary ShareTarget {
201
201
required USVString action;
202
202
DOMString method = "GET";
203
+ DOMString enctype = "application/x-www-form-urlencoded";
203
204
required ShareTargetParams params;
204
205
};
205
206
@@ -260,6 +261,19 @@ <h3>
260
261
developer warning</ a > that the method is not supported, and return
261
262
< code > undefined</ code > .
262
263
</ li >
264
+ < li > If < var > share target</ var > ["< a data-link-for =
265
+ "ShareTarget "> method</ a > "] is an < a data-cite =
266
+ "!INFRA#ascii-case-insensitive "> ASCII case-insensitive</ a > match for
267
+ the string < code > "POST"</ code > and < var > share
268
+ target</ var > ["< a data-link-for ="ShareTarget "> enctype</ a > "] is neither
269
+ an < a data-cite ="!INFRA#ascii-case-insensitive "> ASCII
270
+ case-insensitive</ a > match for the strings
271
+ < code > "application/x-www-form-urlencoded"</ code > nor
272
+ < code > "multipart/form-data"</ code > , < a data-cite =
273
+ "!appmanifest#dfn-issue-a-developer-warning "> issue a developer
274
+ warning</ a > that the enctype is not supported, and return
275
+ < code > undefined</ code > .
276
+ </ li >
263
277
< li > Let < var > action</ var > be the result of < a data-cite =
264
278
"!URL#concept-url-parser "> parsing</ a > the < a data-cite =
265
279
"!URL#concept-url "> URL</ a > < var > share
@@ -301,6 +315,11 @@ <h3>
301
315
"https://tools.ietf.org/html/rfc7231#section-4 "> method</ a > for the
302
316
< a data-link-for ="web share targets "> web share target</ a > .
303
317
</ p >
318
+ < p >
319
+ The < dfn > enctype</ dfn > member specifies how the share data is encoded
320
+ in the body of a < code > POST</ code > request. It is ignored when
321
+ < a > method</ a > is < code > "GET"</ code > .
322
+ </ p >
304
323
< p >
305
324
The < dfn > params</ dfn > member contains a < a > ShareTargetParams</ a >
306
325
dictionary.
@@ -489,6 +508,10 @@ <h3>
489
508
< var > manifest</ var > ["< a > share_target</ a > "]["< a data-link-for =
490
509
"ShareTarget "> method</ a > "].
491
510
</ li >
511
+ < li > Let < var > enctype</ var > be
512
+ < var > manifest</ var > ["< a > share_target</ a > "]["< a data-link-for =
513
+ "ShareTarget "> enctype</ a > "].
514
+ </ li >
492
515
< li > If < var > method</ var > is < code > "GET"</ code > :
493
516
< ol >
494
517
< li > Let < var > query</ var > be the result of running the
@@ -504,7 +527,26 @@ <h3>
504
527
</ li >
505
528
</ ol >
506
529
</ li >
507
- < li > Otherwise, if < var > method</ var > is < code > "POST"</ code > :
530
+ < li > Otherwise, if < var > method</ var > is < code > "POST"</ code > and < var >
531
+ enctype</ var > is < code > "application/x-www-form-urlencoded"</ code > :
532
+ < ol >
533
+ < li > Let < var > body</ var > be the result of running the
534
+ < a data-cite ="!URL#concept-urlencoded-serializer "> < code > application/x-www-form-urlencoded</ code >
535
+ serializer</ a > with < var > entry list</ var > and no encoding
536
+ override.
537
+ </ li >
538
+ < li > Set < var > body</ var > to the result of < a data-cite =
539
+ "!Encoding#utf-8-encode "> encoding</ a > < var > body</ var > .
540
+ </ li >
541
+ < li >
542
+ < a data-cite ="!FETCH/#concept-header-list-append "> Append</ a >
543
+ < code > "Content-Type"</ code > /< code > "application/x-www-form-urlencoded"</ code >
544
+ to < var > header list</ var > .
545
+ </ li >
546
+ </ ol >
547
+ </ li >
548
+ < li > Otherwise, if < var > method</ var > is < code > "POST"</ code > and < var >
549
+ enctype</ var > is < code > "multipart/form-data"</ code > :
508
550
< ol >
509
551
< li > Let < var > body</ var > be the result of running the
510
552
< a data-cite ="!HTML#multipart/form-data-encoding-algorithm "> < code >
522
564
</ li >
523
565
< li >
524
566
< a data-cite ="!FETCH/#concept-header-list-append "> Append</ a >
525
- < code > Content-Type</ code > /< var > MIME type</ var > to < var > header
567
+ < code > " Content-Type" </ code > /< var > MIME type</ var > to < var > header
526
568
list</ var > .
527
569
</ li >
528
570
</ ol >
0 commit comments