From Multi Theft Auto: Wiki

This function sets the HTTP status code that will be sent for the current HTML page.


bool httpSetResponseCode ( int code )

Required Arguments

  • code: the HTTP status code to be set.


Returns true if the code was set successfully, false otherwise.


Click to collapse [-]

This example displays a 'Page not found' error message and the response code 404. The location of the httpSetResponseCode call is unimportant - it can be placed anywhere in the document.

<h1>Page not found!</h1>
<* httpSetResponseCode ( 404 ) *>

See Also

These functions can only be used from within lua blocks in HTML pages hosted by the server