From d1e02f42edab1f0934bf23d887643419b4628b30 Mon Sep 17 00:00:00 2001 From: Nigel Deakin Date: Wed, 10 Jan 2018 17:21:55 +0000 Subject: [PATCH] Update writing.md (#668) Trying to make this a bit clearer --- docs/writing.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/writing.md b/docs/writing.md index d25b3ab4f..f241d90ea 100644 --- a/docs/writing.md +++ b/docs/writing.md @@ -24,10 +24,13 @@ db.update(return_struct) ## Inputs -Inputs are provided through standard input and environment variables. We'll just talk about the default input format here, but you can find others [here](function-format.md). -To read in the function body, just read from STDIN. +Inputs are provided through standard input and environment variables. -You will also have access to a set of environment variables, independent of +The way that input data is supplied to functions depends on the input format (as specified in `func.yml`) that your function is using. + +If you're using `default` format then you can simply read the function input from STDIN. For more information and to find out about other input formats see [Open Function Format](function-format.md). + +Your function also has access to a set of environment variables, independent of the function's format: * `FN_APP_NAME` - the name of the application that matched this route, eg: `myapp` @@ -57,6 +60,8 @@ For `http` format these will be in http headers: * `Fn_method` - the HTTP method used to invoke * `$X` - the HTTP headers that were set for this request, exactly as they were sent in the request. +If you're implementing your function using a fdk this will provide an API to obtain the http headers. + For `json` format, these will be fields in the json object (see [format](functions-format.md)):