- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
在阅读一些关于使用 Twisted 编写 Web 服务器的文章时,我遇到了this page其中包括以下声明:
While it's convenient for this example, it's often not a good idea to make a resource that POSTs to itself; this isn't about Twisted Web, but the nature of HTTP in general; if you do this, make sure you understand the possible negative consequences.
在本文讨论的示例中,资源是使用 GET 请求检索的 Web 资源。
我的问题是,将资源 POST 到自身可能会带来哪些负面后果?我只关心与 HTTP 协议(protocol)相关的方面,所以请忽略我提到的关于 Twisted 的事实。
最佳答案
POST 动词用于在集合中创建新资源。这意味着 POST 到资源没有直接意义(POST 端点应始终是集合,而不是资源)。
如果你想更新你的资源,你应该 PUT 到它。
有时,您不知道是要更新资源还是创建资源(也许您已经在本地创建了它并想创建或更新它)。我认为在那种情况下,PUT 动词更合适,因为 POST 的真正意思是“我想创造一些新东西”。
关于http - 如果 Web 资源 POST 到自身是否危险?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9352885/
编辑:澄清一下,我明白为什么这段代码不起作用,我并不是要修复它,而是想了解如果这段代码可以在没有语义错误的情况下编译会有什么危险。 我发现下面的代码会导致静态语义错误。我知道这是因为 std::lis
我想知道 C# 枚举以及重复值会发生什么。我创建了以下小程序来测试: namespace ConsoleTest { enum TestEnum { FirstElem
正如我在另一个 SO 问题中指出的那样,我遇到了 this article .当我通过 MSVC7.1 编译 boost 1.40 时出现了这个问题,并且弹出了几个 C4251 警告。 现在,在阅读上
我有以下弹出窗口代码(客户端请求)。它使用 eval ,我知道这是危险的。有没有办法重写下面的脚本,使其不使用 (eval)? /* exported popup_default , popup_he
NTFS 文件可以有对象 ID。可以使用 FSCTL_SET_OBJECT_ID 设置这些 ID .然而,msdn article说: Modifying an object identifier c
我一直在学习命令行参数解析。关于这个已经有很长的线索了,我不想在这里挑起一个: Using getopts in bash shell script to get long and short com
这个问题在这里已经有了答案: How to configure ContextMenu buttons for delete and disabled in SwiftUI? (4 个回答) 4 个月
为什么在 linux 的中断处理程序中禁止 printk 或 (I/O)。?在什么情况下中断处理程序中的 I/O 会导致 linux 系统中的死锁? 最佳答案 关于 printk(),它是侵入性的。例
不是 Invoking virtual function and pure-virtual function from a constructor 的重复项: 以前的问题与 C++ 03 相关,而不是
我正在使用 lateinit 属性以避免使用 ?运算符(operator)。我有很多 View 属性是第一次在 getViews() 函数中分配的。如果该功能不存在,我的应用程序将与来自 Kotlin
我最近在使用 fputs 时遇到了问题:当使用 fputs 在文本文件中打印一些字符串时,我碰巧得到了除 A-Z、a-z、0-9 之外的其他字符(不属于字符串的字符) .我绝对确保所有字符串都以空字符
在仅包含字节数组的结构上使用 #pragma pack(1) 是否危险/有风险?例如。这个: #pragma pack(1) struct RpcMessage { uint8_t proto
我是一名优秀的程序员,十分优秀!