Skip to content

Commit a2532e9

Browse files
docs: update curl example with output variables
1 parent b3488ce commit a2532e9

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

streamerbot/4.examples/curl-requests.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ All selected actions will be added to your Streamer.bot installation!
4444

4545
To send an HTTP request using the cURL utility action, you can use the [Set Argument](/api/sub-actions/core/arguments/set-argument) sub-action to set the necessary arguments for the request, and then execute the `wsgs.utils.curl` action by utilizing the [Run Action](/api/sub-actions/core/actions/run-action) sub-action.
4646

47-
### Arguments
47+
### Input Arguments
4848

4949
::field-group
5050

51-
:::field{name="curl.url" type=string required=true}
51+
:::field{name="curl.url" type=string required}
5252
The URL to send the request to.
5353
:::
5454

@@ -94,7 +94,29 @@ For example, `MyStreamerBotClient/1.0` to identify your Streamer.bot instance in
9494
:::
9595
::
9696

97-
### Example
97+
### Output Variables
98+
99+
After executing the `wsgs.utils.curl` action, you can access the following output variables to get information about the response:
100+
101+
::field-group
102+
103+
:::field{name="curl.responseCode" type=number}
104+
The HTTP status code returned by the server in response to the request.
105+
:::
106+
107+
:::field{name="curl.responseBody" type=string}
108+
The raw body of the response returned by the server, if any.
109+
110+
::::tip{to=/examples/parse-json-utility}
111+
If the response is in JSON format, you can use my JSON utility to extract nested values into separate variables!
112+
<br>
113+
:icon{name=mdi:chevron-right} [Read more about `wsgs.utils.json.parse`](/examples/parse-json-utility)
114+
::::
115+
:::
116+
117+
::
118+
119+
## Example
98120

99121
For example, to make a `POST` request with a JSON body, you could set your arguments as follows:
100122

0 commit comments

Comments
 (0)