# Object - TWebResponse Web 响应 ## `TWebResponse` 声明:class TWebResponse 内置对象 ### `create()` 声明:function 创建 TWebResponse 实例 可见性:public ### `getCustomHeader(name)` 声明:function 读取CustomHeaders里的内容 可见性:public | 参数 | 类型 | 说明 | | --- | --- | --- | | `name` | string | 要取的名字 | 返回:string ### `sendRedirect(uri)` 声明:function 发送重定向 可见性:public | 参数 | 类型 | 说明 | | --- | --- | --- | | `uri` | string | 重定向的路径 | 返回:any ### `sendResponse()` 声明:function 发送响应包 可见性:public 返回:any ### `sendStream(stream)` 声明:function 发送流 可见性:public | 参数 | 类型 | 说明 | | --- | --- | --- | | `stream` | TStream | 要发送的内容 | 返回:any ### `sent()` 声明:function 是否已发送。已经发送则设置头信息没有意义 可见性:public 返回:boolean ### `setCookieField(values, domain, path, expires, secure)` 声明:function 设置Cookie字段 可见性:public | 参数 | 类型 | 说明 | | --- | --- | --- | | `values` | TStringList | TStrings类型,Cookie的内容,可为多个 | | `domain` | string | 字符串类型,Cookie的有效域 | | `path` | string | 字符串类型,有效Path | | `expires` | datetime | 时间类型,过期时间 | | `secure` | boolean | Boolean类型,是否安全Cookie,如果是则仅当HTTPS链接被支持 | 返回:any ### `setCustomHeader(name, value)` 声明:function 设置header字段 可见性:public | 参数 | 类型 | 说明 | | --- | --- | --- | | `name` | string | Header里的键名 | | `value` | string | Header里的值 | 返回:any ### `Allow` 声明:property 服务器所支持的逗号分隔的方法列表。最少需要支持GET和HEAD方法 可见性:public 类型:string 访问:read/write ### `ContentEncoding` 声明:property 返回的内容传输的编码方式,如GZIP 可见性:public 类型:string 访问:read/write ### `ContentLength` 声明:property 设置全部返回内容的长度 可见性:public 类型:integer 访问:read/write ### `ContentStream` 声明:property 返回目前在正在输出的流 可见性:public 类型:TStream 访问:read ### `ContentType` 声明:property 返回的内容的类型,包括字符集如html/text; charset=gb2312 可见性:public 类型:string 访问:read/write ### `ContentVersion` 声明:property 返回的内容的版本 可见性:public 类型:string 访问:read/write ### `Cookies` 声明:property 返回的Cookie列表对象,可用该对象添加Cookie 可见性:public 类型:TCookieCollection 访问:read ### `CustomHeaders` 声明:property 设置或者读取Headers对象,可利用该对象来设置Header的具体内容 可见性:public 类型:TStringList 访问:read/write ### `Date` 声明:property 当前发送的内容的时间 可见性:public 类型:datetime 访问:read/write ### `DerivedFrom` 声明:property 内容生成者 可见性:public 类型:string 访问:read/write ### `Expires` 声明:property 内容过期的时间 可见性:public 类型:datetime 访问:read/write ### `HttpRequest` 声明:property 获得REPONSE相关的客户请求对象 可见性:public 类型:TWebRequest 访问:read ### `LastModified` 声明:property 内容的最终更新时间 可见性:public 类型:datetime 访问:read/write ### `Location` 声明:property 设置要跳转的路径 可见性:public 类型:string 访问:read/write ### `LogMessage` 声明:property 用来跟踪记录调试的串 可见性:public 类型:string 访问:read/write ### `Realm` 声明:property 未授权时告诉客户端所需授权的路径集 可见性:public 类型:string 访问:read/write ### `ReasonString` 声明:property 当返回错误的时候所需要的原因串 可见性:public 类型:string 访问:read/write ### `Server` 声明:property 提供服务的应用的标示串 可见性:public 类型:string 访问:read/write ### `StatusCode` 声明:property 返回的状态吗,200表示正确 可见性:public 类型:integer 访问:read/write ### `Title` 声明:property 内容的标题 可见性:public 类型:string 访问:read/write ### `Version` 声明:property 协议版本 可见性:public 类型:string 访问:read/write ### `WWWAuthenticate` 声明:property 401错误发生时支持逗号分隔的认证方法列表 可见性:public 类型:string 访问:read/write