Browse Source

HTTP `error` should be `status` code in `readme.md` (#303)

HTTP `error` should be `status` code in `readme.md`
master
Vsevolod Strukchinsky 7 years ago
committed by Leo Lamprecht
parent
commit
98f5f867b6
  1. 2
      readme.md

2
readme.md

@ -184,7 +184,7 @@ module.exports = async (req, res) => {
##### `send(res, statusCode, data = null)` ##### `send(res, statusCode, data = null)`
- Use `require('micro').send`. - Use `require('micro').send`.
- `statusCode` is a `Number` with the HTTP error code, and must always be supplied. - `statusCode` is a `Number` with the HTTP status code, and must always be supplied.
- If `data` is supplied it is sent in the response. Different input types are processed appropriately, and `Content-Type` and `Content-Length` are automatically set. - If `data` is supplied it is sent in the response. Different input types are processed appropriately, and `Content-Type` and `Content-Length` are automatically set.
- `Stream`: `data` is piped as an `octet-stream`. Note: it is _your_ responsibility to handle the `error` event in this case (usually, simply logging the error and aborting the response is enough). - `Stream`: `data` is piped as an `octet-stream`. Note: it is _your_ responsibility to handle the `error` event in this case (usually, simply logging the error and aborting the response is enough).
- `Buffer`: `data` is written as an `octet-stream`. - `Buffer`: `data` is written as an `octet-stream`.

Loading…
Cancel
Save