jquery / jquery/api.jquery.com
Documentation for ajax does not mention FormData
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 325
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
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
dataparameter can be aFormDataobject - Setting
contentTypeto false will in this case automatically create a correctcontentTypeheader including aboundaryspecification
This allowed me to solve my problem, but the documentation does not mention it and could be improved.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the $.ajax documentation entry and review the data and contentType parameter sections. Document the FormData behavior and the contentType setting described in the issue; it is done when the multipart/form-data usage and boundary handling are clearly covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jquery
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100