Sunday, June 19, 2016

Robo4j brick-client POST request using JSON arrays

   The 1st robo4j brick-client POST request version has been using JSON field "command". There was not  implemented support for JSON Arrays. Old POST command has also any type of response. The robo4j socket has been only closed.
--OLD POST--
$curl -H "Content-Type: application/json" -X 
POST -d '{"command" : "right=10;left=10;back=20;move=50"}' http://:8022
   Robo4j alfa-0.2 release introduces POST request with JSON Arrays support. The new array field has name "commands". 
--NEW POST--
$curl -H "Content-Type: application/json" -X POST -d '{"commands" : 
       [{"name" : "move", "value" : "20"},
        {"name" : "back", "value" : "20"}
       ]}' http://:8022
  The new POST request also provides the simple response. The response consists from the HTTP header and text message:
No Information about POST
   The new support of JSON Arrays will allow in upcoming future much better integration with 3rd party technologies.  

@miragemiko has written the short blog post with attached video. The video shows the stability of the robo4j-brick-client.

No comments:

Post a Comment