Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hapijs/hapi into 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran Hammer committed Nov 5, 2014
2 parents 200bb97 + cc1fcc0 commit 5074dc2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,15 +489,18 @@ The following options are available when adding a route:
be any result value accepted by [`reply()`](#replyresult).

- `payload` - determines how the request payload is processed:
- `output` - the type of payload representation requested where:
- `data` - the incoming payload is read fully into memory. If `parse` is `true`, the payload is parsed (JSON, form-decoded,
- `output` - the type of payload representation requested. The value must be one of:
- `'data'` - the incoming payload is read fully into memory. If `parse` is `true`, the payload is parsed (JSON, form-decoded,
multipart) based on the 'Content-Type' header. If `parse` is false, the raw `Buffer` is returned. This is the default value
except when a proxy handler is used.
- `stream` - the incoming payload is made available via a `Stream.Readable` interface. If the payload is 'multipart/form-data' and
- `'stream'` - the incoming payload is made available via a `Stream.Readable` interface. If the payload is 'multipart/form-data' and
`parse` is `true`, fields values are presented as text while files are provided as streams. File streams from a
'multipart/form-data' upload will also have a property `hapi` containing `filename` and `headers` properties.
- `file` - the incoming payload in written to temporary file in the directory specified by the server's `payload.uploads` settings.
If the payload is 'multipart/form-data' and `parse` is `true`, fields values are presented as text while files are saved.
- `'file'` - the incoming payload in written to temporary file in the directory specified by the server's `payload.uploads` settings.
If the payload is 'multipart/form-data' and `parse` is `true`, fields values are presented as text while files are saved. Note that
it is the sole responsibility of the application to clean up the files generated by the framework. This can be done by keeping track
of which files are used (e.g. using the `request.app` object), and listening to the server `'response'` event to perform any needed
cleaup.
- `parse` - can be `true`, `false`, or `gunzip`; determines if the incoming payload is processed or presented raw. `true` and `gunzip`
includes gunzipping when the appropriate 'Content-Encoding' is specified on the received request. If parsing is enabled and the
'Content-Type' is known (for the whole payload as well as parts), the payload is converted into an object when possible. If the
Expand Down

0 comments on commit 5074dc2

Please sign in to comment.