Topic Path: Symbol Reference > Classes > TIdHTTPResponseInfo Class > TIdHTTPResponseInfo Methods > WriteHeader Method
ContentsIndexHome
PreviousUpNext
TIdHTTPResponseInfo.WriteHeader Method

Generates headers for the HTTP response.

procedure WriteHeader;
Parameters 
Description 
Dest 
Destination stream used as a buffer for the headers. Default value is Nil. 

WriteHeader is a procedure used to generate HTTP headers for the HTTP response. WriteHeader will raise an EIdHTTPHeaderAlreadyWritten exception if HeaderHasBeenWritten indicates that HTTP headers have already been generated. 

WriteHeader generates the following HTTP header values: 

 

Content-Type 
Content-Length 
WWW-Authenticate 
Set-Cookie 

 

WWW-Authenticate is generated when AuthRealm contains a non-empty value. ResponseNo is set to 401 when AuthRealm is used. 

Set-Cookie is generated for each value in Cookies

Dest is an optional TStream used as a local buffer for header values. When Dest is not Nil, headers are written to Dest and not to Connection

Use WriteContent to generate the content for the HTTP response.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.