document optional url arg in request

This commit is contained in:
Leo Horie 2016-11-11 18:20:42 -05:00
parent 717186a3b6
commit 2ed7184012
2 changed files with 10 additions and 1 deletions

View file

@ -18,10 +18,11 @@
### API
`stream = m.request(options)`
`stream = m.request([url,] options)`
Argument | Type | Required | Description
---------------------- | --------------------------------- | -------- | ---
`url` | `String` | No | If present, it's equivalent to having the options `{method: "GET", url: url}`. Values passed to the `options` argument override options set via this shorthand.
`options.method` | `String` | Yes | The HTTP method to use. This value should be one of the following: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD` or `OPTIONS`.
`options.url` | `String` | Yes | The URL to send the request to. The URL may be either absolute or relative, and it may contain [interpolations](#dynamic-urls).
`options.data` | `any` | No | The data to be interpolated into the URL and serialized into the querystring (for GET requests) or body (for other types of requests).