Fetch URL

Fetch a remote URL and retrieve the response body
Preview
Preview
This sub-action behaves much like the URL commands in Nightbot and many other bots.

Parameters

URLrequired
Text

Enter the URL to fetch

Only GET requests are supported at this time.
If you need support for additional methods such as POST, utilize C# sub-actions
Variable Namerequired
Text

Enter the name of the variable to store the response in

Parse result as JSON
Toggle
default:false

Optionally parse the result as JSON

Multiple variables will be populated, with the Variable Name you provided as the root key

For example, a request to https://catfact.ninja/fact, with variable name jsonResult, would populate the variables jsonResult.fact and jsonResult.length.

Headers
Table

Optionally add custom headers to modify the HTTP request

Variables

The following variables will be populated after executing this sub-action:

Description
<variableName>string

If Parse result as JSON is disabled:

The full text of the response body

Example: { "fact": "Both humans and cats have identical regions in the brain responsible for emotion.", "length": 81 }
<variableName>.<jsonKey>

If Parse result as JSON is enabled:

All json properties will be dynamically mapped to variables by key

Example: <variableName>.fact: "Both humans and cats have identical regions in the brain responsible for emotion."