HolyLib Wiki

HttpResponse

HttpResponse

This class represents the HttpResponse that is created when a incoming request is received

Metatable function Description
__tostring Returns a formated string of the VoiceData -> HttpResponse
__index Used to find the functions on the metatable and access saved variables
__newindex Used to allow one to save variables on the object

Methods

table HttpResponse:GetTable( )
Returns the lua table used by newindex and index
boolean HttpResponse:IsValid( )
Returns whether this HttpResponse is valid.
HttpResponse:SetContent( string content, string contentType = text/plain )
Sets the content for the response.
HttpResponse:SetHeader( string key, string value )
Sets the given value for the given key in the header.
HttpResponse:SetRedirect( string url, number code = 302 )
Redirects one to the given URL and returns the given code.
HttpResponse:SetStatusCode( number status )
Sets the status code of the response, clamped between 100 and 600.