Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodiHttpResponse.SetStatus

procedure SetStatus(aCode: Integer; const aReason: string = '');
Sets the status code, and optionally the reason phrase. Leave aReason empty - the normal case - and the standard phrase for the code is used, or 'Status <n>' for a code this unit does not know. The reason phrase is decorative in HTTP/1.1 and does not exist at all in HTTP/2, where only the code is carried, so do not put information in it that a client might need. One with a control character other than HTAB, or DEL, is replaced by the standard phrase. Call it BEFORE or AFTER setting content, as you prefer: content only promotes the status when it is still the initial 404.