From 189310e0239ec263bfb056ea77ca6d5c534d36a6 Mon Sep 17 00:00:00 2001 From: Erfan Mirzapour <52346515+ErfanMirzapour@users.noreply.github.com> Date: Tue, 4 May 2021 18:11:32 +0430 Subject: [PATCH] docs(response-helpers): Update res.json definition --- docs/api-routes/response-helpers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-routes/response-helpers.md b/docs/api-routes/response-helpers.md index 61baff4d5f1e3..0418b2362e446 100644 --- a/docs/api-routes/response-helpers.md +++ b/docs/api-routes/response-helpers.md @@ -23,7 +23,7 @@ export default function handler(req, res) { The included helpers are: - `res.status(code)` - A function to set the status code. `code` must be a valid [HTTP status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) -- `res.json(json)` - Sends a JSON response. `json` must be a valid JSON object +- `res.json(body)` - Sends a JSON response. `body` must be a [serialiazable object](https://developer.mozilla.org/en-US/docs/Glossary/Serialization) - `res.send(body)` - Sends the HTTP response. `body` can be a `string`, an `object` or a `Buffer` - `res.redirect([status,] path)` - Redirects to a specified path or URL. `status` must be a valid [HTTP status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes). If not specified, `status` defaults to "307" "Temporary redirect".