http.md
October 8, 2016 ยท View on GitHub
HTTP EZ Streams
import * as ez from 'ez-streams'
server = ez.devices.http.server(listener, options)
Creates an EZ HTTP server.
Thelisteneris called aslistener(request, response, _)
whererequestis an EZ reader andresponsean EZ writer.
For a full description of this API, seeHttpServerRequest/Responsein https://github.com/Sage/ez-streams/blob/master/lib/node-wrappers.mdclient = ez.devices.http.client(options)
Creates an EZ HTTP client.
clientis an EZ writer.
The response object returned byclient.response(_)is an EZ reader.
For a full description of this API, seeHttpClientRequest/Responsein https://github.com/Sage/ez-streams/blob/master/lib/node-wrappers.mdlistener = ez.devices.http.listener(listener, options)
wraps an ez-streams listener as a vanilla node.js listenerfactory = ez.factory("http://user:pass@host:port/...")Use reader for a GET request, writer for POST requestreader = factory.reader(_)writer = factory.writer(_)