Class Server
The Server class is used to control a scripted webserver using node.js that will respond to HTTP requests with queued responses.
Queued responses will be served to requests using a FIFO order. All requests received by the server are stored on the node.js server and can be retrieved by calling Server::getReceivedRequests().
Mock responses that don't require data to be transmitted over HTTP a great for testing. Mock response, however, cannot test the actual sending of an HTTP request using cURL. This test server allows the simulation of any number of HTTP request response transactions to test the actual sending of requests over the wire without having to leave an internal network.
public
|
|
public
|
|
public
|
#
enqueue( array|
Queue an array of responses or a single response on the server. |
public
boolean
|
|
public
string
|
|
public
integer
|
|
public
array
|
|
public
|
|
public
|
integer |
DEFAULT_PORT
|
#
8124
|
string |
REQUEST_DELIMITER
|
#
"\n----[request]\n"
|