The Http module allows requests and
responses over the underlaying
stack.
The create function can be used to create an Http
module eg.
(create Http)
Once created, this module is tailored using its properties
and methods.
However, an Http module is often created in the process of
creating a comms stack by using the function
buildCommsStack.
An Http module supports the following properties:
| property name | property type | description |
|---|---|---|
root |
String | the root directory for the files available to the web server |
mode |
String | the mode has value either server (default)
or client depending on whether this module is being used
to connect to a remote service or accept calls as a local one
|
stack |
Stack | the layers of the stack below this module in the full stack |
log |
Log | a log for the HTTP connection |
The Http module supports the following standard methods:
| method name | description |
|---|---|
receive |
receive a HttpRequest
or HttpResponse
depending if the
mode property is server or client
|
send |
send the supplied HttpResponse or
HttpRequest depending if the
mode property is server or client
|
In addition, it supports the following HTTP-specific methods:
| method name | description |
|---|---|
receiveRequest |
receive an HttpRequest |
receiveResponse |
receive an HttpResponse |
sendRequest |
send an HttpRequest |
sendResponse |
send an HttpResponse |
receiveRequestReceive an HttpRequest. This is used when acting as a HTTP server. The supplied timeout is in milli-seconds.
Arguments:
| timeout | Integer |
Return type: HttpRequest
receiveResponseReceive an HttpResponse. This is used when acting as a HTTP server. The supplied timeout is in milli-seconds.
Arguments:
| timeout | Integer |
Return type: HttpResponse
sendRequestSend an HttpRequest. This is used when acting as a HTTP client.
Arguments:
| request | HttpRequest |
Return type: the empty List ()
sendResponseSend an HttpResponse. This is used when acting as a HTTP server.
Arguments:
| response | HttpResponse |
Return type: the empty List ()
| Contents | Index | Current topic: communications | Related topics: communications classes, objects |