Internet Direct (Indy)
Home
PreviousUpNext
TIdHTTPResponseInfo.WriteContent Method

Generates the HTTP response content.

Pascal
procedure WriteContent;

WriteContent is a procedure used to generate the content for the HTTP response. WriteContent generates the content using either ContentText, or ContentStream when assigned, for ResponseNo values in the range 200

  • 499 inclusive. If ResponseNo is not in this range, only the
ResponseNo and ResponseText is included in the content of the HTTP response. 

WriteContent calls WriteHeader when HeaderHasBeenWritten contains False. WriteHeader is generally used for responses where the Content length is unknown. 

WriteContent uses methods in Connection to transfer the content of the HTTP response to the HTTP client. When ContentStream is assigned, the WriteStream method in Connection is called. When ContentText is non-blank, the Write method is called. Otherwise, WriteLn is used to send an HTML document containing the HTTP ResponseNo and ResponseText

WriteContent sets ContentText to an empty string ('') and releases the ContentStream to signify that the content of the HTTP response has been written.

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.