Show last authors
1 (% class="box infomessage" %)
2 (((
3 Sends a web request to a specified URL. Stores the answer in a specified variable.
4
5 **ATTENTION: Web requests are very powerful, but also very dangerous.**
6 [[Learn more ~>~>>>doc:Documentation.Web requests.WebHome]]
7
8 [[[[image:send-web-request-brick.png]]>>doc:Documentation.Web requests.WebHome]]
9 )))
10
11 (% class="row" %)
12 (((
13 (% class="col-xs-12 col-sm-6" %)
14 (((
15 (% class="box" %)
16 (((
17 ==== **Example** ====
18
19 Sends a web request to retrieve a random joke. The answer is extracted with the help of regular expressions.
20
21 [[image:send-web-request-example.png||alt="store-column-example.png"]]
22
23 The free joke api returns data in the following json format:
24
25 **{"id":10,"type":"general","setup":"What kind of shoes does a thief
26 wear?","punchline":"Sneakers"}**
27
28
29 To extract the setup phrase in case you stored the result in variable "joke", use the following regular expression:
30 **regular expression( '"setup":"(.*?)"' , "joke" )**
31
32
33 The result will be: What kind of shoes does a thief wear?
34
35
36 To extract the setup phrase, use the following regular expression:
37 **regular expression( '"punchline":"(.*?)"' , "joke" )**
38
39 The result will be: Sneakers
40 )))
41 )))
42
43 (% class="col-xs-12 col-sm-6" %)
44 (((
45 (% class="box" %)
46 (((
47 ==== **Result** ====
48
49 [[[[image:null4.png||alt="Download"]]>>https://share.catrob.at/app/project/045e7be6-db1a-11ea-a5c3-005056a36f47]]
50
51 [[image:send-web-request-example.gif||alt="store-column-example.gif"]]
52 )))
53 )))
54 )))