RESTful services vs HTML
Wildatheart
Posts: 195
Mike, in another thread you wrote, "I originally designed the Spinneret libraries for RESTful services. However, the community for some reason latched onto HTML. I guess I need to build another example."
In the couple of project examples I posted recently, I was happy to receive 4 bits of data via the Spinneret/internet using my cell phone to drive some hardware. Although my current programming ability limits me to one way communication with the Spinneret, I hope to experiment with using the return value "xmlstr" (if I referred to the variable correctly from your epin.htm).
This will tell you that (at this time) I'm either POSTing and not GETing, or I'm GETing and not POSTing. I again reviewed your tutorial, and I looked at a couple of additional explanations. For sure, I'm not GETing 'it'! (No pun intended.)
What exactly do the Spinneret libraries for RESTful services do that HTML doesn't do? Does it expand capability to send and receive files, strings, etc.?
Your epin.htm has been an excellent! source of learning for me. If my use of epin has been limited to HTML, could you please provide something similar to take advantage of RESTful services.
In the couple of project examples I posted recently, I was happy to receive 4 bits of data via the Spinneret/internet using my cell phone to drive some hardware. Although my current programming ability limits me to one way communication with the Spinneret, I hope to experiment with using the return value "xmlstr" (if I referred to the variable correctly from your epin.htm).
This will tell you that (at this time) I'm either POSTing and not GETing, or I'm GETing and not POSTing. I again reviewed your tutorial, and I looked at a couple of additional explanations. For sure, I'm not GETing 'it'! (No pun intended.)
What exactly do the Spinneret libraries for RESTful services do that HTML doesn't do? Does it expand capability to send and receive files, strings, etc.?
Your epin.htm has been an excellent! source of learning for me. If my use of epin has been limited to HTML, could you please provide something similar to take advantage of RESTful services.
Comments
Now we're seeing the Spinneret code evolve and folks are starting to ask, How do I get the values into a application. Well, the answer is right in front of you... only you can't see the XML through the HTML.
All togther...
You can type the url (use you Spinneret IP) and see the XML response in a browser. The service URL is what you want in the VB app not the web page.
http://forums.parallax.com/showthread.php/146147-Sending-bytes-from-Spinneret-to-Visual-Basic?p=1165347&viewfull=1#post1165347
You're not seeing the XML through the HTML.
You could request the web page with VB but that would be a pain in the butt to parse.
So, if I now see the XML through the HTML, I have only one other question that will hopefully be answered after I review the code Doggiedoc is using for his chicken coup that being, the transfer of byte and string data via XML. Thanks again for your very clear examples.
When the main page is loaded, the entire HTLM page is rendered, div, table and all. The main page contains a timer which retrieves the dynamically generated div containing the table of values every X. The dynamically generated HTML replaces the current div element. This was done using JQuery which is a very powerful JavaScript library.
When you say "transfer of byte and string data via XML" I think you're asking how to cast the data into types. I believe the key here is understanding the current protocol we're using which is HTTP. HTTP is a text base protocol. All the data is represented as ASCII characters.
If you're goal is to send different data types to the client, XML over HTTP is a good way to go. The elements wrap the data which makes the whole thing somewhat self defining. However, you still need to convert ASCII numeric encoded values to their numeric equivalent for calculation purposes. If your goal is to send actual numeric values not ASCII, that's very doable. The downside is you'll have to create a protocol. You'll need to know where the data elements start and stop, which elements are strings, which are numeric, value length, etc. That involves rolling your own server application. Simply take a look at the DNS or DHCP object for pointers.
Doggiedoc, converted the numeric sensor values to ASCII before rendering the sensor values. He's not doing any calculation on the values - just display - so no need to convert ASCII to integer.