httpSetResponseCode | Multi Theft Auto: Wiki Skip to content

httpSetResponseCode

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


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

Syntax

bool httpSetResponseCode ( int code )
Required Arguments
  • code: MISSING_PARAM_DESC

Returns

  • bool: value

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

Code Examples

shared

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

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