Websockets HTTP - sociam/indx GitHub Wiki
Basics
The HTTP wrapper is used to issue arbitrary HTTP calls to this server through the websocket. This reduces the overhead of creating new HTTP requests each time, in particular the overhead of a new TLS handshake.
Use an action
of value http
in all requests.
Fields
request
- This is the actual HTTP request, which has the following subfields:
HTTP Request Object
uri
- The full URI of the request e.g.http://i.ld.is:8211/somebox
method
- The HTTP method to emulate, e.g.POST
,GET
,PUT
path
- The path of the request e.g./somebox
params
-GET
parameters as a subobject in the format:
{"keyname": ["value1", "value2"], "anotherkey", ["value"]}
- note that values are always arrays.
content
- The body of the HTTP request, usuallyPOST
variables whenPOST
is the method.
Response
As with other methods, the respond_to
will be set to http
, and requestid
will match the incoming requestid
from the request.