All Projects → Satak → webrequest-action

Satak / webrequest-action

Licence: MIT license
GitHub action for web requests

Programming Languages

javascript
184084 projects - #8 most used programming language
powershell
5483 projects

Projects that are alternatives of or similar to webrequest-action

unity-http
A handy wrapper for the Unity WebRequest system.
Stars: ✭ 44 (+7.32%)
Mutual labels:  webrequest
PsNetTools
PsNetTools is a cross platform PowerShell module to test network features on Windows, Linux and Mac.
Stars: ✭ 13 (-68.29%)
Mutual labels:  webrequest
CoinHive-blocker
Blocks unwanted cryptominers in your browser (plug-in)
Stars: ✭ 26 (-36.59%)
Mutual labels:  webrequest

Web Request Action

A GitHub Action to make a web request to any JSON API. Supports all HTTP methods, custom headers, JSON payload, data fetch and basic authentication.

Test Status Release

Usage

GET request

uses: satak/webrequest-action@master
with:
  url: https://my-json-server.typicode.com/typicode/demo/posts
  method: GET

POST request with headers and basic auth

uses: satak/webrequest-action@master
with:
  url: https://webhook.site/${{ secrets.WEBHOOK_ID }}
  method: POST
  payload: '{"name": "${{ env.MY_NAME }}"}'
  headers: '{"Authentication": "Token ${{ env.TOKEN }}"}'
  username: ${{ secrets.BASIC_AUTH_UN }}
  password: ${{ secrets.BASIC_AUTH_PW }}

Inputs

Parameter Required Info
url true Web request URL endpoint
method true Web request method (GET, POST, PUT, PATCH, DELETE)
payload false Web request payload in JSON format
headers false Web request headers in JSON format
username false Basic auth username
password false Basic auth password

Outputs

Output format: JSON

{
  "output": {
    "url": "<str url>",
    "method": "<str method>",
    "payload": {},
    "time": "<str time>",
    "statusCode": "<int statusCode>",
    "data": "object/array data from API"
  }
}

Example output usage

run: |
  $output = '${{ steps.webhook.outputs.output }}' | ConvertFrom-Json
  Write-Host "Time from output $($output.time) statusCode $($output.statusCode) data $($output.data)"

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].