//htmlClient 客户端 import string.html; import web.rest.client; namespace web.rest; class htmlClient{ ctor( ... ){ this = ..web.rest.client( ... ); this.parseResponseResult = function(s){ var t = this._http.responseContentType; if( t && ..string.match( t,"[\w\/]*<@@html@>![\W]" ) ) return ..string.html( s ); s = ..string.trim(s); if( s[1] == '<'# ){ return ..string.html( s ); } return; } this.acceptType = "application/html,text/html,*/*"; }; } namespace htmlClient{ var http = ..web.rest.htmlClient(); get = http.get; post = http.post; delete = http.delete; put = http.put; patch = http.patch; } /**intellisense() web.rest.htmlClient = REST 客户端。\n请求数据,返回数据都使用 string.html 文档对象 web.rest.htmlClient( = 创建 REST 客户端。\n请求数据,返回数据都使用 string.html 文档对象 web.rest.htmlClient(.("UserAgent","代理服务器","绕过代理的主机",连接选项) = 创建 REST 客户端,所有参数可选。\nUserAgent 用于自定义 User-Agent 请求标头,用于服务器识别请求程序特征。\nHTTP 代理服务器请指定为 "代理服务器地址:端口" 格式,\n\nSOCKS 代理服务器请指定为 "socks=代理服务器地址:端口" 格式 \n└── [代理格式说明](doc://library-guide/std/inet/proxy.md)\n\n"绕过代理的主机" 用法参考 inet.setProxy 源码的示例,一般不需要指定。\n连接选项可用一个数值参数指定打开会话的选项,一般不需要指定。 web.rest.htmlClient() = !web_restClient. end intellisense**/ /**intellisense(web.rest.htmlClient) get(.(网址,参数表) = 使用该GET方法提交请求,获取资源\n请求参数将会自动转换为URL附加参数,\n请求参数可以指定表或字符串,如果是表请求前会转换为字符串\n成功返回数据,失败返回空值,错误信息,错误代码 post(.(网址,参数表) = 使用该POST方法提交请求,新增或修改资源\n请求参数可以指定表或字符串,如果是表请求前会转换为字符串\n成功返回数据,失败返回空值,错误信息,错误代码 delete(.(网址,参数表) = 使用该DELETE方法提交请求,删除资源\n请求参数可以指定表或字符串,如果是表请求前会转换为字符串\n成功返回数据,失败返回空值,错误信息,错误代码 put(.(网址,参数表) = 使用该PUT方法提交请求,替换或更新资源\n请求参数可以指定表或字符串,如果是表请求前会转换为字符串\n成功返回数据,失败返回空值,错误信息,错误代码 patch(.(网址,参数表) = 使用该PATCH方法提交请求,更新资源\n请求参数可以指定表或字符串,如果是表请求前会转换为字符串\n成功返回数据,失败返回空值,错误信息,错误代码 get() = !string_xml. post() = !string_xml. delete() = !string_xml. put() = !string_xml. patch() = !string_xml. end intellisense**/