HolyLib Wiki

HttpServer:AddPreparedResponse

  HttpServer:AddPreparedResponse( number userID, string path, string method, function callback )

Description

Experimental! Adds a prepared response for the given userID.
A prepared response won't make any lua call when it matches a incoming request, multiple responses can be queued as their responses in order.
The callback function provides the HttpResponse object which you should use to set all return values.

Arguments

1number userID
2string path
3string method
4function callback

the callback is called instantly

Function argument(s):
1HttpResponse response -

The respone in which you should set/prepare the response

Function return argument(s):