5
$\begingroup$

Channel-Based communication is available since release 11.0 as an experimental functionality for publish-subscribe communication between WL sessions or with external systems.

Functionality works well between WL sessions, but when trying to send messages through external systems, I was unable to make this work.

myChannel = CreateChannel["demo", Permissions -> "Public"]
(*ChannelObject["https://channelbroker.wolframcloud.com/users/[email protected]/demo"]*)

listener = ChannelListen[myChannel];
Dynamic[listener["Message"]]

ChannelSend[myChannel, <|key -> "test"|>]
(*Message Successful*)

Prepare command for curl (or web browser)
url = URLBuild[listener["URL"], {"operation" -> "send", "Message" -> "yet another message"}]

(*"https://channelbroker.wolframcloud.com/users/user%40example.com/demo?operation=send&Message=another+message"*)

(*Sending Message through the Mathematica Session works*)
URLExecute[url]
(*message ID*)

When trying through terminal with curl URL, or through the web browser, the following message is displayed:

403 Forbidden

$\endgroup$
1
  • $\begingroup$ I can replicate this problem. It happens just as you have described. $\endgroup$
    – C. E.
    Commented Feb 2, 2017 at 0:38

1 Answer 1

4
$\begingroup$

When copying a URL to external programs, make sure that you are using Edit > Copy As > Plain Text (Cmnd-Shift-C on Mac)... or otherwise remove the line continuation characters ("\") that the Front End inserts in the copied text.

As yet another trick, you can execute:

Hyperlink[url]

... and then click the output link. That will use the correct URL in your default web browser.

$\endgroup$
1
  • $\begingroup$ Dear Igor, thank you. I've got some extra questions about channel networks that I wouldwant to ask you. Please can you contact me via the wolfram community if you can $\endgroup$
    – Zviovich
    Commented Feb 3, 2017 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.