Snap4Arduino icon indicating copy to clipboard operation
Snap4Arduino copied to clipboard

[enhancement] Better POST request to HTTP server

Open enricorox opened this issue 6 years ago • 1 comments

Hi! With a POST request we can make multiple variable update, but what about a vars-update and a message broadcast in a single request? Should be useful a POST request with +var1=5&broadcast=+updates This can notify a "var1" update to a hat block listening for +"updates".

Thank you so much for your work :+1:

enricorox avatar May 17 '19 21:05 enricorox

Hi @enricorox ,

We will consider your proposal, allowing more parameters into the GET requests. I'm not sure now, because we have a very simple listener, and the current feature allows the character "&" as a normal character into messages and variable values. Yes, we can encode it, but current projects are using this plain feature. Anyway, I want to share with you that we have decided (last week, in our MicroBlocks and Snap! meeting) to implement the Web Thing Model in all our web communications (as a standard). Then, we will add this protocol to our Snap4Arduino web server (keeping our current protocol enabled). So, playing with a JSON object, we will be able to do more things and, most importantly, it will be a unique protocol for connecting with all our projects (made with Snap! or Snap4Arduino or MicroBlocks or even all the Mozilla web things).

Joan

jguille2 avatar May 18 '19 10:05 jguille2