Carapace

Http Comms Module

The Http module allows requests and responses over the underlaying stack.

Http Creation

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.

Http Properties

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

Http Methods

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


receiveRequest

Receive an HttpRequest. This is used when acting as a HTTP server. The supplied timeout is in milli-seconds.

Arguments:

timeoutInteger

Return type: HttpRequest


receiveResponse

Receive an HttpResponse. This is used when acting as a HTTP server. The supplied timeout is in milli-seconds.

Arguments:

timeoutInteger

Return type: HttpResponse


sendRequest

Send an HttpRequest. This is used when acting as a HTTP client.

Arguments:

requestHttpRequest

Return type: the empty List ()


sendResponse

Send an HttpResponse. This is used when acting as a HTTP server.

Arguments:

responseHttpResponse

Return type: the empty List ()


Contents Index Current topic: communications Related topics: communications classes, objects