Inputs ​
đź’ˇ Click on the Input Name for more Details.
| Input Name | Default Value | Short Description of the Input Value |
|---|---|---|
| url | Required | URL for Request |
| method | POST | Request Method |
| data | - | Request Data JSON/YAML |
| headers | - | Request Headers JSON/YAML |
| params | - | Request Parameters JSON/YAML |
username | - | Basic Auth Username |
password | - | Basic Auth Password |
insecure | false | Ignore SSL Errors |
| file | - | File Path to Send |
name | file | File Form Key Name |
See the Examples section for more options.
Details ​
url Required ​
The URL to send the request too. You may include params here or in the params key.
method ​
The request method, including custom methods.
Default: POST
data ​
Body JSON or YAML data. Only used for PUT, POST, DELETE, and PATCH.
Data is parsed with JSON.parse or yaml.load, js-yaml.
View Multi-Line JSON/YAML Example
data: |
key1: value1
key2: value2data: |
{
"key1": "value1",
"key2": "value2"
}headers ​
Headers JSON or YAML data.
params ​
Parameters, Query String, JSON or YAML data. These may also be provided in the url.
file ​
When sending a file, multipart/form-data wil be used and data will be added to the form data with the key name. The file path is relative to the workspace/working directory.
For more information on inputs, see: https://axios-http.com/docs/req_config
- name: 'Web Request'
uses: cssnr/web-request-action@v1
with:
url: https://httpbin.org/postExamples ​
đź’ˇ Click on an example heading to expand or collapse the example.
Algolia Start Crawl
- name: 'Algolia Start Crawl'
uses: cssnr/web-request-action@v1
with:
url: https://crawler.algolia.com/api/1/crawlers/${{ secrets.CRAWLER_ID }}/reindex
username: ${{ secrets.CRAWLER_USER_ID }}
password: ${{ secrets.CRAWLER_API_KEY }}Deploy to Render
- name: 'Render Deploy'
uses: cssnr/web-request-action@v1
with:
url: ${{ secrets.RENDER_HOOK }}
params: |
imgURL: ghcr.io/${{ github.repository }}:${{ github.ref_name }}Make a GET Request
- name: 'Web Request'
uses: cssnr/web-request-action@v1
with:
url: https://httpbin.org/get
method: 'GET'Send Data
- name: 'Web Request'
uses: cssnr/web-request-action@v1
with:
url: https://httpbin.org/post
data: '{"key": "value"}'Send File
- name: 'Web Request'
uses: cssnr/web-request-action@v1
with:
url: https://httpbin.org/post
file: path/to/file.txt
name: file # Default - name of file keyAll Inputs
- name: 'Web Request'
uses: cssnr/web-request-action@v1
with:
url: https://httpbin.org/post
method: 'POST'
data: '{"key": "value"}'
headers: |
key: value
params: |
{
"key": "value"
}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
insecure: false
file: path/to/file.txt
name: fileFor more examples, you can check out other projects using this action:
https://github.com/cssnr/web-request-action/network/dependents
Â
WARNING
These docs are not finished. Please see the README.md on GitHub.
