Browse Source

Document body parsing

pull/20/head
Luke Childs 6 years ago
parent
commit
6eb3f8e841
  1. 7
      README.md

7
README.md

@ -46,6 +46,13 @@ createTestServer().then(server => {
}); });
``` ```
The following `Content-Type` headers will be parsed and exposed via `req.body`:
- JSON (`application/json`)
- Text (`text/plain`)
- URL-encoded form (`application/x-www-form-urlencoded`)
- Buffer (`application/octet-stream`)
`createTestServer()` has a Promise based API that pairs well with a modern asynchronous test runner such as [AVA](https://github.com/avajs/ava). `createTestServer()` has a Promise based API that pairs well with a modern asynchronous test runner such as [AVA](https://github.com/avajs/ava).
You can create a separate server per test: You can create a separate server per test:

Loading…
Cancel
Save