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

update fetch guide #34278

Merged
merged 14 commits into from
Jun 28, 2024
Prev Previous commit
Next Next commit
Update files/en-us/web/api/fetch_api/using_fetch/index.md
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
  • Loading branch information
wbamberg and Josh-Cena committed Jun 21, 2024
commit f67e6ddd0247aafcd7615741dc0f20193a46a1c8
2 changes: 1 addition & 1 deletion files/en-us/web/api/fetch_api/using_fetch/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ If the `mode` option is set to `no-cors`, then `method` must be one of `GET`, `P

### Setting a body

The request body is the payload of the request: it's the thing the client is sending to the server. You won't include a body with `GET` requests, but you will include it in requests that send content to the server, such as {{httpmethod("POST")}} or {{httpmethod("PUT")}} requests. For example, if you want to upload a file to the server, you might make a `POST` request and include the file as the request body.
The request body is the payload of the request: it's the thing the client is sending to the server. You cannot include a body with `GET` requests, but it's useful for requests that send content to the server, such as {{httpmethod("POST")}} or {{httpmethod("PUT")}} requests. For example, if you want to upload a file to the server, you might make a `POST` request and include the file as the request body.

To set a request body, pass it as the `body` option:

Expand Down