版本说明
4.0 版
Safe Browsing API (v4) 中包含以下更新和新功能。
Lookup API(版本 4)
相同之处:
- 该 API 仍让客户端直接查询 Google 安全浏览服务器和安全浏览列表。
不同之处:
- 不再支持 HTTP
GET
方法。请改用 HTTP POST
方法。
- 现在,
key
参数是 HTTP POST
请求网址中所需的唯一参数。
- HTTP
POST
请求和响应格式已更改。不再支持纯文本。
请改用 JSON。
Update API (v4)
相同之处:
- 此 API 仍让客户端定期更新本地数据库列表中的 SHA256 哈希前缀。
- 该 API 还有一个类似的请求,会在客户端遇到哈希前缀冲突时检索 SHA256 完整长度哈希。
不同之处:
- 现在,
key
参数是 HTTP POST
请求网址中所需的唯一参数。
- HTTP
POST
请求和响应格式已更改。不再支持纯文本。
请改用 JSON。
- 更新的编码方式已更改。现在,该 API 使用简单的版本控制协议提供差异比较,而不是提供添加分块和子分块。客户端会将其当前状态连同请求的更新一起发送到服务器。服务器会返回新的客户端状态和差异信息,以使客户端完全更新。
- 为了确保在考虑客户端限制时最大限度地减少对保护的影响,该 API 会提供优先威胁列表。系统会使用设备资源、带宽、地理定位和其他信号向每个客户端传送优先级最高的威胁数据。
threatLists.list 方法
新方法 threatLists.list
可返回当前可供查询或下载的安全浏览列表的列表。
状态代码
服务器为响应 HTTP POST
请求而生成的 HTTP 状态代码已更改。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-02。
[null,null,["最后更新时间 (UTC):2023-12-02。"],[[["Safe Browsing APIs v4 transitions to using HTTP `POST` requests with JSON format, replacing the previous `GET` method and plain text format."],["The Update API v4 introduces a new diff-based update system for efficient threat list management and prioritizes threat lists based on client context."],["A new `threatLists.list` method enables retrieval of available Safe Browsing lists."],["The `key` parameter is now the sole requirement in HTTP `POST` request URLs for both Lookup and Update APIs."],["Updated HTTP status codes reflect the changes in request and response handling within the v4 APIs."]]],["Safe Browsing API (v4) updates include changes to both the Lookup and Update APIs. The `GET` method is replaced by `POST`, and plain text is replaced by JSON for requests and responses. The `key` parameter is now the sole required URL parameter. Updates are now encoded as diffs using a versioning protocol. The API serves prioritized threat lists based on client constraints. A new `threatLists.list` method lists available Safe Browsing lists, and HTTP status codes have been revised.\n"]]