httpSetResponseHeader | Multi Theft Auto: Wiki Skip to content

httpSetResponseHeader

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

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

httpSetResponseHeader ( )

Code Examples

server

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
*>