小编tux*_*yer的帖子

什么REST PUT/POST/DELETE调用应按约定返回?

  1. 根据"REST意识形态",PUT/POST/DELETE请求的响应主体应该是什么?

  2. 返回代码怎么样?是否HTTP_OK足够?

  3. 如果有的话,这些公约的原因是什么?

我发现了一篇描述POST/PUT差异的好帖子:POST vs PUT 但它仍然没有回答我的问题.

rest post http http-delete

150
推荐指数
2
解决办法
11万
查看次数

无法将GAE应用程序数据存储备份到GS存储桶

:这里所描述我想备份数据存储GAE对GS桶https://developers.google.com/appengine/docs/adminconsole/datastoreadmin#Backup_And_Restore.我试图在表单中提供存储桶名称:

bucket 
/gs/bucket
/gs/bucket/path
Run Code Online (Sandbox Code Playgroud)

但不是它的工作.每次收到消息时:

There was a problem kicking some off the jobs/tasks:
Invalid bucket name: 'bucket'
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?是否有可能将所有数据(包括blob文件)备份到GS而无需为此编写自定义代码?

google-app-engine database-backups google-cloud-storage google-cloud-datastore

13
推荐指数
2
解决办法
2901
查看次数

收集问题中的Scala自我类型和this.type

我试图在scala中围绕抽象和显式自我类型.让我们考虑这个例子:我想为可扩展树创建一个简单的基础:

trait Tree {
  def children: Iterable[Tree]
  def descendants: Iterable[Tree] = { val dv = children.view; dv ++ (dv.flatMap { _.children }) }
}
Run Code Online (Sandbox Code Playgroud)

但是,我希望能够使用某些方法扩展树节点并使用以下方法: tree.children foreach { _.newMethod() }

为此,我尝试过:

A. this.type:失败

trait Tree {
    def children: Iterable[this.type] 
    def descendants: Iterable[this.type] = {
      val dv = children.view
      // FAIL: type mismatch;  found   :  scala.collection.IterableView[com.abovobo.data.Tree,Iterable[_]]  required: Iterable[Tree.this.type] 
      // dv ++ (dv.flatMap { _.children })
      // OK: 
      dv.++[this.type, Iterable[this.type]](dv.flatMap[this.type, Iterable[this.type]]{ _.children })
    }
}
Run Code Online (Sandbox Code Playgroud)

工作变体非常笨拙.

B.摘要类型:失败

trait Tree {
    type Node …
Run Code Online (Sandbox Code Playgroud)

scala self-type abstract-type

9
推荐指数
2
解决办法
414
查看次数