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 (deprecated) |
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):2025-03-06。
[null,null,["最后更新时间 (UTC):2025-03-06。"],[[["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"]]