Wolfram Language

Channel Framework

Collect Data from HTTP Requests

Start a listener that speaks the value of the parameter param when a message containing param arrives.

In[1]:=
Click for copyable input
listener = ChannelListen["speak", Speak["Arrived " <> ToString[Lookup[#Message, "param"]]] &, Permissions -> "Public"]
Out[1]=

Send a message to the listener from a terminal on the same or any other machine using cURL, and hear your listener speak.

In[2]:=
Click for copyable input
"curl \"" <> URLBuild[listener["URL"], {"operation" -> "send", "param" -> 123}] <> "\""
Out[2]=
Out[3]=

Send a message from a web browser.

In[4]:=
Click for copyable input
URLBuild[listener["URL"], {"operation" -> "send", "param" -> 456}]
Out[4]=
Out[5]=

Send a message from a Wolfram System.

In[6]:=
Click for copyable input
ChannelSend[$WolframID <> ":speak", <|"param" -> 789|>]
Out[6]=

All data received by the listener.

In[7]:=
Click for copyable input
listener["Dataset"]
Out[7]=

Related Examples

de es fr ja ko pt-br ru zh