Internet Direct (Indy)
Home
PreviousUpNext
TIdHTTPResponseInfo.WriteHeader Method

Generates headers for the HTTP response.

Pascal
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.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.