From 9c88f56777128eb7282596df8677f4a2061b94f0 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 18 Jun 2018 22:24:27 -0600 Subject: [PATCH] fix comments --- README.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2329d4e..ae3a5fd 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,21 @@ request('http://www.google.com', function (error, response, body) { The first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional. -- `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()` +- `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()` - `method` - http method (default: `"GET"`) - `headers` - http headers (default: `{}`) + + --- -- `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object. -- `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON. @@ -60,7 +67,10 @@ The first argument can be either a `url` or an `options` object. The only requir --- -- `encoding` - encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.) @@ -117,7 +127,7 @@ There are at least two ways to debug the operation of `request`: 2. Set `require('@coolaj86/urequest').debug = true` at any time (this does the same thing as #1). -