Skip to end of metadata
Go to start of metadata

Thing creates a HTTP server, GadgetKeeper connects to it to send a request and receive a response.

Communication Protocols:HTTP
RPC Protocol:JSON-RPC 2.0
How it works:
  1. Thing creates a socket server
  2. GadgetKeeper opens a connection to Thing HTTP server
  3. GadgetKeeper sends a command to the connection
  4. Thing receives the command from the connection
  5. Thing sends a response to the connection
  6. GadgetKeeper receives the response
  7. GadgetKeeper closes the connection
Constraints:
  1. Thing must be reachable from GadgetKeeper

 

Connection Settings


FieldRequiredDescriptionDialog
Namexconnection name
Protocolxselect "json-rpc over http"
HostxThing host
PortxThing HTTP server port
Secure use SSL
Virtual path URL path
Connection, msx

number of milliseconds GadgetKeeper can spent on connection to Thing

Response, msx

number of milliseconds GadgetKeeper will wait for Thing

to receive message and send response

Date formatx

date format representation:

  • iso-8601 - date is represented as string (example: "2013-05-27UTC06:07:16Z")
  • unix-timestamp - not supported, date is represented as number (example: 1369634836)
Description connection description

 

Example Scenario Using HTTP


Given

  1. Thing has remote method "echo" 
  2. Thing wants to be able to handle this method


Workflow

  1. Thing creates a socket server
  2. GadgetKeeper opens a connection to Thing HTTP server
  3. GadgetKeeper sends a JSON command to the connection:

  4. Thing receives the JSON command and sends a response back to the connection:

  5. GadgetKeeper receives the response and closes the connection

 



 

  • No labels