Adding ability to return headers without setting debug mode (#51)

* Update httpClient.js
* Update README.md
* Update action.yml

Co-authored-by: Nick Hills <nick.hills@valtech.com>
This commit is contained in:
Nick Hills
2022-08-17 08:56:02 +01:00
committed by GitHub
parent cce3f3d779
commit 4cbc7a46b2
4 changed files with 8 additions and 0 deletions

View File

@@ -48,6 +48,7 @@ jobs:
| Variable | Description |
|---|---|
`response` | Response as JSON String
`headers` | Headers
To display HTTP response data in the GitHub Actions log give the request an `id` and access its `outputs`. You can also access specific field from the response data using [fromJson()](https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson) expression.
@@ -61,6 +62,7 @@ steps:
- name: Show Response
run: |
echo ${{ steps.myRequest.outputs.response }}
echo ${{ steps.myRequest.outputs.headers }}
echo ${{ fromJson(steps.myRequest.outputs.response).field_you_want_to_access }}
```