简体   繁体   English

HTTP PUT用于新文件创建和目录创建

[英]HTTP PUT for new file creation and directory creation

How would a HTTP Server differentiate whether the request in PUT is for a folder creation or a file creation in a directory. HTTP Server如何区分PUT中的请求是用于创建文件夹还是目录中的文件。

For HTTP GET what I understood is, if the URL has a trailing /, then HTTP Server looks out for a folder with that name and, if does not exist can look out for a file. 对于HTTP GET,据我了解,如果URL带有尾部/,则HTTP Server会查找具有该名称的文件夹,如果不存在,则可以查找文件。

How does this work for PUT for a new file and folder creation? 这对于创建新文件和文件夹的PUT如何起作用?

HTTP (the protocol) doesn't have any concept of files or folders. HTTP(协议)没有文件或文件夹的任何概念。 URIs are opaque, except when a relative URI reference is resolved against a base URI. URI是不透明的,除非相对于基本URI解析了相对URI引用。

If you want your server to provide file/folder services, you may want to look into WebDAV (RFC 4918). 如果希望服务器提供文件/文件夹服务,则可能需要研究WebDAV(RFC 4918)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM