Table of Contents

THttpResponse Class

Abstract base class for HTTP response objects that implement IHttpResponse.

Remarks

Concrete engine implementations derive from this class to expose the status, headers, and content of a received response. It transparently decodes deflate and gzip content encodings when the content is read.

Syntax

Unit: Sparkle.Http.Engine

THttpResponse = class(TInterfacedObject, IHttpResponse);

Constructors

Name Description
Create Creates the response and initializes an empty header collection.

Properties

Name Description
Chunked Indicates whether the response is sent using chunked transfer encoding.
ContentAsBytes Gets the response content body as a byte array.
ContentAsStream Gets the response content body as a readable stream.
ContentEncoding Gets the value of the original response Content-Encoding header.
ContentLength Gets the length, in bytes, of the response content body.
ContentType Gets the value of the response Content-Type header.
Headers Gets the collection of HTTP headers received with the response.
StatusCode Gets the HTTP status code of the response, such as 200 or 404.
StatusReason Gets the textual reason phrase associated with the status code.