bromagosa / Snap4Arduino

Binding Snap! and Arduino together
http://snap4arduino.rocks
GNU Affero General Public License v3.0
134 stars 85 forks source link

[enhancement] Better POST request to HTTP server #282

Closed enricorox closed 1 year ago

enricorox commented 5 years ago

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:

jguille2 commented 5 years ago

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