Send web request to [value] and store answer in [variable]

admin 於 2023/11/01 15:18 最後修改

Sends a web request to a specified URL. Stores the answer in a specified variable.

ATTENTION: Web requests are very powerful, but also very dangerous.
Learn more >>

send-web-request-brick.png

Example

Sends a web request to retrieve a random joke. The answer is extracted with the help of regular expressions.

store-column-example.png

The free joke api returns data in the following json format:

{"id":10,"type":"general","setup":"What kind of shoes does a thief
wear?","punchline":"Sneakers"}

To extract the setup phrase in case you stored the result in variable "joke", use the following regular expression:
regular expression( '"setup":"(.*?)"' , "joke" )

The result will be: What kind of shoes does a thief wear?

To extract the setup phrase, use the following regular expression:
regular expression( '"punchline":"(.*?)"' , "joke" )

The result will be: Sneakers

Result

Download

store-column-example.gif