From 0526d263133faec9fbabcdc83910d4bbd816c18b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adnan=20Hajdarevi=C4=87?= Date: Tue, 9 Jun 2015 18:28:47 +0200 Subject: [PATCH] Updated Referencing Request Values (markdown) --- Referencing-Request-Values.md | 92 +++++++++++++++++------------------ 1 file changed, 44 insertions(+), 48 deletions(-) diff --git a/Referencing-Request-Values.md b/Referencing-Request-Values.md index 3147da4..70c29cc 100644 --- a/Referencing-Request-Values.md +++ b/Referencing-Request-Values.md @@ -1,65 +1,61 @@ # Referencing request values There are three types of request values: - 1. HTTP Request Header values - ```json - { - "source": "header", - "name": "Header-Name" - } - ``` +1. HTTP Request Header values - 2. HTTP Query parameters + ```json + { + "source": "header", + "name": "Header-Name" + } + ``` - ```json - { - "source": "url", - "name": "parameter-name" - } - ``` +2. HTTP Query parameters - 3. Payload (JSON or form-value encoded) + ```json + { + "source": "url", + "name": "parameter-name" + } + ``` - ```json - { - "source": "payload", - "name": "parameter-name" - } - ``` +3. Payload (JSON or form-value encoded) + ```json + { + "source": "payload", + "name": "parameter-name" + } + ``` - *Note:* For JSON encoded payload, you can reference nested values using the dot-notation. - For example, if you have following JSON payload + *Note:* For JSON encoded payload, you can reference nested values using the dot-notation. + For example, if you have following JSON payload - ```json - { - "commits": - [ - { - "commit": + ```json + { + "commits": [ { - "id": 1 + "commit": { + "id": 1 + } + }, { + "commit": { + "id": 2 + } } - }, - { - "commit": - { - "id": 2 - } - } - ] - } - ``` + ] + } + ``` - You can reference the first commit id as + You can reference the first commit id as - ```json - { - "source": "payload", - "name": "commits.0.commit.id" - } - ``` + ```json + { + "source": "payload", + "name": "commits.0.commit.id" + } + ``` - If the payload contains a key with the specified name "commits.0.commit.id", then the value of that key has priority over the dot-notation referencing. + If the payload contains a key with the specified name "commits.0.commit.id", then the value of that key has priority over the dot-notation referencing. # Special cases If you want to pass the entire payload as JSON string to your command you can use