[Contents] [Previous] [Next] [Index]

addResponseHeader

Adds new information to the response header sent to the client.

Server-side function

Implemented in

Netscape Server 3.0

Syntax

addResponseHeader(field, value)

Parameters

field
A field to add to the response header.

value
The information to specify for that field.

Description

You can use the addResponseHeader function to add information to the header of the response you send to the client.

For example, if the response you send to the client uses a custom content type, you should encode this content type in the response header. The JavaScript runtime engine automatically adds the default content type (text/html) to the response header. If you want a custom header, you must first remove the old default content type from the header and then add the new one. If your response uses royalairways-format as a custom content type, you would specify it this way:

deleteResponseHeader("content-type");
addResponseHeader("content-type","royalairways-format");
You can use the addResponseHeader function to add any other information you want to the response header.

Remember that the header is sent with the first part of the response. Therefore, you should call these functions early in the script on each page. In particular, you should ensure that the response header is set before any of these happen:

See also

deleteResponseHeader


[Contents] [Previous] [Next] [Index]

Last Updated: 10/31/97 16:38:00


Copyright © 1997 Netscape Communications Corporation