Message Boards Message Boards

[LiVE] Building Wolfram Cloud APIs to JS Frontends and Serverless Backends

9 Replies

I am fine fine with the POST method, but I wasn't successful. Can you offer a suggestion?

Thanks Michael

POSTED BY: Michael Johnston

Hey, I just found these videos and they are great! I have a project where i want to use Wolfram as the backend to a microservice and this series covers the subject in more detail than i ever hoped to find. In addition to the subject coverage, I really appreciated watching the debugging and the practical discussions around how you go about building these services, handling errors, reals and such.

I have a question: The APIFunction calls take a simple flat association. I want to send a nested JSON structure that may include lists of objects and could run up to several K bytes. Is there a way to put the input data in the body of the message instead of the URL?

POSTED BY: Michael Johnston

Hi there, this might help you:

https://reference.wolfram.com/language/ref/AllowedCloudParameterExtensions.html

This is the easiest way to do it, it's not using Body as JSON however. But if you are fine in sending the payload as POST encoded data and add the payload in one of the parameters, you can do that.

Let me know if that helps.

Riccardo

Good timing. I'll have a look at the URL and give you some feedback.
I recently notice https://reference.wolfram.com/language/WolframNotebookEmbedder/ and have been testing it. Just today I noticed the community post Wolfram Notebook Embedder https://community.wolfram.com/groups/-/m/t/1788578 released by Jan Poeschko. You can see my comments down the post - to summarize - I use ReactJS and NodeJS extensivly and I've always wanted a way for a React component (at arbitragy levels in the component tree) to be responcible for the creation and mangement of WL containers (full of WL goodies) so that React can be used to control and App state and render requriements such that when a WL container living in a React component is part of the render - well - let the magic happen.

Posted 5 years ago

Very cool! Thanks for piloting this I just watched the first session, it's extremely beneficial: the WebExecute framework is one of the latest areas of WL that I've started exploring, and I can't believe I went this long without using it.

I also didn't realize I could extract parts of Message objects: passing error messages of failed API calls back to front-end code is a very good use case of why you'd want to have such flexible structures.

Love the tips of trade bit about lack of analogous structures between languages, like the Real value parameters, and adjusting them to fit the JS code.

Just a lot of great stuff in here, and I'm only one session in!

POSTED BY: Jesse Dohmann

I happy you're enjoying and finding it useful. I can't wait to here what you have to say after the 4 vedio ;-)

This is an excellent and thorough exploration of Wolfram Language-as-backend design, which is a very powerful paradigm for when a FormFunction frontend doesn't quite cut it. I particularly enjoyed the discussion in session 3 of image sizing and formatting, which is a tricky problem I've dealt with several times and still haven't quite gotten the hang of!

Also, regarding IntegerName, I tried it with a Real and (despite its name) it seems to work:

In[1]:= IntegerName[-0.01]

Out[1]= "minus zero point zero one"
POSTED BY: Jesse Friedman

Thank you for your comments and the slap on the back of the head ;-) Perhaps it a version thing. I swear I tried it and I sure am happy you showed me because I don’t know when I would have come back to this.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract