javascript - Google Analytics API 返回没有正文的 204 响应

标签 javascript google-analytics google-analytics-api google-apis-explorer

此 Google Analytics API 调用 https://developers.google.com/apis-explorer/#search/analytics/analytics/v3/analytics.management.uploads.deleteUploadData返回 204,没有消息正文。至少它返回一些 header :

cache-control:  no-cache, no-store, max-age=0, must-revalidate
date:  Tue, 08 Aug 2017 12:44:42 GMT
etag:  "sP5LBgqDii7ksJERAgMB0CpTbRM/vyGp6PvFo4RvsFtPoIWeCReyIC8"
expires:  Mon, 01 Jan 1990 00:00:00 GMT
pragma:  no-cache
server:  GSE
vary:  Origin, X-Origin

与 googleapis@17.1.0 node module 的行为相同.

编辑:mentioned通过 m90 ,这应该表明服务器已满足请求,但在我的 Analytics 帐户中没有上传项目被删除。

最佳答案

204状态代码翻译为 "No Content"

The server has fulfilled the request but does not need to return an entity-body, and might want to return updated metainformation. The response MAY include new or updated metainformation in the form of entity-headers, which if present SHOULD be associated with the requested variant.

在 RESTful 服务中,删除实体时响应 204 和空正文是一种常见模式,就像您描述的调用一样(引用 Custom data source Id for the uploads to be deleted. (string) )。本问题:REST API error return good practices有关如何从 RESTful 服务读取状态代码的详细信息。

关于javascript - Google Analytics API 返回没有正文的 204 响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45569386/

相关文章:

google-analytics - Google跟踪代码管理器中的电子商务跟踪问题

javascript - 如何在谷歌分析中设置多个跟踪器

javascript - 谷歌分析 : _setvar to new tracking code

java - Google Analytics Java API 过滤器更新错误

javascript - 带下划线和时间戳的无限 url

javascript - DIV 隐藏元素间距调整

javascript - 位置栏未出现在适用于 iOS、Cordova 的 InAppBrowser 中

google-api - Google Analytics API 请求返回验证码?

google-analytics - 如何使用 Google Analytics 为第三方网站创建跟踪像素?

javascript - 如何从 Service Worker 打开新的浏览器窗口