Documentation for ajax does not mention FormData

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
48/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
jquery
領域
documentation

調査の方向性

$.ajax のドキュメント項目から始め、data パラメーターと contentType パラメーターのセクションを確認します。FormData の動作と、issue で説明されている contentType の設定をドキュメント化します。multipart/form-data の使用方法と boundary の処理が明確に網羅されていれば完了です。

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

説明

It took me quite a while to find how to create an AJAX request with a fixed ordering of transferred arguments (even if the same name occurs multiple times) with a multipart/form-data encoding. I ended up posting a question to StackOverflow (https://stackoverflow.com/q/76545035/2240052) and found a related question with an answer that makes use of the following undocumented behavior of $.ajax:

  • The data parameter can be a FormData object
  • Setting contentType to false will in this case automatically create a correct contentType header including a boundary specification

This allowed me to solve my problem, but the documentation does not mention it and could be improved.

主要言語
HTML
スター
324
フォーク
259
平均マージ
1日 30分
マージ済み PR(30日)
1

環境構築

はじめの一歩

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

jquery/api.jquery.com のほかの issue

jquery/api.jquery.com の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

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

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