Method: hashLists.batchGet
HTTP 请求
GET https://safebrowsing.googleapis.com/v5alpha1/hashLists:batchGet
网址采用 gRPC 转码语法。
查询参数
参数 |
names[] |
string
必需。特定哈希列表的名称。该列表可以是威胁列表,也可以是全局缓存。名称不得重复;否则客户端将收到错误消息。
|
version[] |
string (bytes format)
客户端已有的哈希列表版本。如果这是客户端首次提取哈希列表,则该字段应留空。否则,客户端应提供之前从服务器收到的版本。客户端不得操纵这些字节。 客户端不需要按照与相应列表名称相同的顺序发送版本。客户端在请求中发送的版本数量可能会少于或多于名称数量。但是,客户端不得发送同名的多个版本;否则客户端将收到错误消息。 历史备注:在 API V4 中,这称为 states ;为清楚起见,现已将其重命名为 version 。 使用 base64 编码的字符串。
|
desiredHashLength |
enum (HashLength )
所返回哈希的所需哈希前缀长度(以字节为单位)。然后,服务器将返回此指定长度的所有哈希前缀。 不同的哈希列表对 desiredHashLength 字段的可接受值有不同的要求。您可以在 HashListMetadata 的 supportedHashLengths 字段中找到此信息。如果 desiredHashLength 未在 supportedHashLengths 中指定值,则系统会向客户端返回错误。 特别是对于 BatchGetHashListsRequest ,客户端无法为不同的列表指定不同的 desiredHashLength 。如果需要这样做,客户端应拆分成多个 BatchGetHashListsRequest 。
|
sizeConstraints |
object (SizeConstraints )
每个列表的大小限制。如果省略,则不会有任何约束。请注意,此处的大小是按列表列出的,而不是所有列表的汇总大小。
|
响应正文
包含多个哈希列表的响应。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"hashLists": [
{
object (HashList )
}
]
} |
字段 |
hashLists[] |
object (HashList )
按请求中指定的顺序排列哈希列表。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-10-11。
[null,null,["最后更新时间 (UTC):2024-10-11。"],[[["Batch retrieve multiple hash lists efficiently, rather than using individual Get requests."],["Specify desired hash lists by name, versions (if previously fetched), desired hash prefix length, and optionally, size constraints."],["Receive a response containing the requested hash lists in the specified order."],["This method adheres to the standard batch Get method as defined by Google AIP and uses the GET HTTP method."],["Request body should be empty for this operation."]]],["This document details the `batchGet` method for retrieving multiple hash lists via a `GET` HTTP request to `safebrowsing.googleapis.com/v5alpha1/hashLists:batchGet`. Required parameters include `names[]` for specifying hash lists and `version[]` for indicating existing versions. `desiredHashLength` defines the desired hash prefix length, and `sizeConstraints` limits list sizes. The request body is empty, and the response contains an array `hashLists[]`, ordered as requested.\n"]]