From 98821edcda31522d6df74cf809c1ad613658d47b Mon Sep 17 00:00:00 2001 From: Pablo Ois Lagarde Date: Tue, 9 Dec 2014 10:21:15 -0300 Subject: [PATCH] Improved jsonReviver documentation --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d056f7111..b0820e12c 100644 --- a/README.md +++ b/README.md @@ -537,7 +537,8 @@ The first argument can be either a `url` or an `options` object. The only requir (the default is `chunked: true`). In non-chunked requests, data items with body streams are not allowed. * `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above. -* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON, with an optional `jsonReviver` that is passed to `JSON.parse()`. +* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON. +* `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body. * `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request. * `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request. * `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.