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