Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fetch in FormData guide #30295

Merged
merged 5 commits into from
Nov 17, 2023
Merged

Use fetch in FormData guide #30295

merged 5 commits into from
Nov 17, 2023

Conversation

wbamberg
Copy link
Collaborator

Part of #30131.

The only real weirdness in here is that I removed the link to the Glitch demo, because:

  • it used XHR, and I couldn't update it because it's Glitch
  • I couldn't even see the code, so it didn't seem particularly helpful

@wbamberg wbamberg requested a review from a team as a code owner November 15, 2023 22:42
@wbamberg wbamberg requested review from Elchi3 and removed request for a team November 15, 2023 22:42
@github-actions github-actions bot added the Content:WebAPI Web API docs label Nov 15, 2023
Copy link
Contributor

github-actions bot commented Nov 15, 2023

Preview URLs

(comment last updated: 2023-11-16 16:54:58)

@wbamberg wbamberg changed the title [XHR] Use fetch in FormData guide Use fetch in FormData guide Nov 15, 2023
Copy link
Contributor

@teoli2003 teoli2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice!

I have a few nits but besides these, this is ready.

Co-authored-by: Jean-Yves Perrier <[email protected]>
@wbamberg wbamberg requested a review from teoli2003 November 16, 2023 16:44
```

> **Note:** The fields "userfile" and "webmasterfile" both contain a file. The number assigned to the field "accountnum" is immediately converted into a string by the [`FormData.append()`](/en-US/docs/Web/API/FormData/append) method (the field's value can be a {{ domxref("Blob") }}, {{ domxref("File") }}, or a string: **if the value is neither a `Blob` nor a `File`, the value is converted to a string**).
> **Note:** The fields `"avatar"` and `"webmasterfile"? both contain a file. The number assigned to the field `"accountnum"` is immediately converted into a string by the [`FormData.append()`](/en-US/docs/Web/API/FormData/append) method (the field's value can be a {{ domxref("Blob") }}, {{ domxref("File") }}, or a string: _if the value is neither a `Blob` nor a `File`, the value is converted to a string_).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[mdn-linter] reported by reviewdog 🐶

Suggested change
> **Note:** The fields `"avatar"` and `"webmasterfile"? both contain a file. The number assigned to the field `"accountnum"` is immediately converted into a string by the [`FormData.append()`](/en-US/docs/Web/API/FormData/append) method (the field's value can be a {{ domxref("Blob") }}, {{ domxref("File") }}, or a string: _if the value is neither a `Blob` nor a `File`, the value is converted to a string_).
> **Note:** The fields `"avatar"` and `"webmasterfile"? both contain a file. The number assigned to the field`"accountnum"`is immediately converted into a string by the [`FormData.append()`](/en-US/docs/Web/API/FormData/append) method (the field's value can be a {{ domxref("Blob") }}, {{ domxref("File") }}, or a string: _if the value is neither a`Blob`nor a`File`, the value is converted to a string\_).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why it wants to do this.

```

> **Note:** The fields "userfile" and "webmasterfile" both contain a file. The number assigned to the field "accountnum" is immediately converted into a string by the [`FormData.append()`](/en-US/docs/Web/API/FormData/append) method (the field's value can be a {{ domxref("Blob") }}, {{ domxref("File") }}, or a string: **if the value is neither a `Blob` nor a `File`, the value is converted to a string**).
> **Note:** The fields `"avatar"` and `"webmasterfile"? both contain a file. The number assigned to the field `"accountnum"` is immediately converted into a string by the [`FormData.append()`](/en-US/docs/Web/API/FormData/append) method (the field's value can be a {{ domxref("Blob") }}, {{ domxref("File") }}, or a string. If the value is neither a `Blob` nor a `File`, the value is converted to a string).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[mdn-linter] reported by reviewdog 🐶

Suggested change
> **Note:** The fields `"avatar"` and `"webmasterfile"? both contain a file. The number assigned to the field `"accountnum"` is immediately converted into a string by the [`FormData.append()`](/en-US/docs/Web/API/FormData/append) method (the field's value can be a {{ domxref("Blob") }}, {{ domxref("File") }}, or a string. If the value is neither a `Blob` nor a `File`, the value is converted to a string).
> **Note:** The fields `"avatar"` and `"webmasterfile"? both contain a file. The number assigned to the field`"accountnum"`is immediately converted into a string by the [`FormData.append()`](/en-US/docs/Web/API/FormData/append) method (the field's value can be a {{ domxref("Blob") }}, {{ domxref("File") }}, or a string. If the value is neither a`Blob`nor a`File`, the value is converted to a string).

Copy link
Contributor

@teoli2003 teoli2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@teoli2003 teoli2003 merged commit 56dbf87 into mdn:main Nov 17, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants