httpSetResponseHeader | Multi Theft Auto: Wiki Skip to content

httpSetResponseHeader

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 value for the specified HTTP response header of the current HTML page.

Syntax

bool httpSetResponseHeader ( string headerName, string headerValue )
Required Arguments
  • headerName: MISSING_PARAM_DESC
  • headerValue: MISSING_PARAM_DESC

Returns

  • bool: value

Returns true if the header value was set successfully, false otherwise.

Code Examples

shared

Using httpSetResponseHeader to set the content type. (Example fromhttpWrite)

<*
local file = fileOpen ( "icons/icon.png" )
if file then
while not fileIsEOF(file) do
buffer = fileRead(file, 500)
httpWrite(buffer, buffer:len())
end
fileClose(file)
httpSetResponseHeader ( "content-type", "image/png")
else
*>
Could not read file
<*
end
*>