向DataTablesClearTable接口发送一个POST请求可以清除数据表格的所有内容. 这种用法和SQL的TRUNCATE用法类似. 请注意当数据表格为某个数据关系的源时,则无法清除表格中数据
元素/属性 | 类型 | 描述 |
---|---|---|
ApiKey | string | 你的 API key, 用于身份验证. 必填 |
TableName | string | 数据表格名称. 必填. |
成功的清除将获得一个 HTTP 204 No Content 无内容应答.
POST https://api.esv2.com/v2/Api/DataTablesClearTable/ HTTP/1.1
Accept-Encoding: gzip,deflate
User-Agent: Jakarta Commons-HttpClient/3.1
Host: api.esv2.com
Content-Length: 269
<ApiRequest xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xs=”http://www.w3.org/2001/XMLSchema”>
<ApiKey>test_api_key1</ApiKey>
<TableName>Table1</TableName>
</ApiRequest>
|
HTTP/1.1 204 No Content
Cache-Control: private
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Wed, 28 Oct 2009 15:35:17 GMT
Content-Length: 0
|
HTTP/1.1 400 Bad Request
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Wed, 28 Oct 2009 11:32:07 GMT
Content-Length: 273
<ApiResponse xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
<ErrorMessage>
<Code>400</Code>
<Message>Data tables that are destination of any relationship cannot be cleared.</Message>
</ErrorMessage>
</ApiResponse>
|