TTMSMCPHTTPServerHeaders Class
The headers of one request or response, addressed by name.
API unit family: TMS.MCP.HTTPServer
Inherits from: TPersistent
Syntax
TTMSMCPHTTPServerHeaders = class(TPersistent)
Remarks
Names are matched without regard to case, so a header set as content-type is found as Content-Type. Each name holds one value; setting a name that is already present replaces it, while TTMSMCPHTTPServerHeaders.AddValue appends to it instead. The collection owns the header objects it holds and frees them when they are replaced, removed or cleared. Read a value with TTMSMCPHTTPServerHeaders.Get and write one with TTMSMCPHTTPServerHeaders.SetHeader; there is no indexed default property. Order is not preserved. Headers come back in whatever order the underlying map yields, which matters when reading back the raw block.
Properties
| Name | Description |
|---|---|
| AllHeaders | The stored headers, for iterating over the whole collection. Read-only. |
| RawWideHeaders | The whole collection as one block of name: value lines. |
Methods
| Name | Description |
|---|---|
| AddValue | Adds a value to a header, keeping any value already stored under that name. |
| Clear | Removes every header and frees them. |
| Exists | Reports whether a header is present, whatever its value. |
| Get | Returns the value stored under a header name. |
| GetIfExists | Looks a header up and reports both whether it was present and its value. |
| Remove | Removes a header and frees it. |
| SetHeader | Sets a header, replacing any value already stored under that name. |