开发者

HTTP POST vs HTTP PUT

Does HTTP PUT have advantages over HTTP POST, particularly for File Uploads? Data transfer should 开发者_运维百科be highly secure. Your ideas / guidance on this will be of great help.


PUT is designed for file uploads moreso than POST which requires doing a multipart upload, but then it comes down to what your server can do as to which is more convenient for you to implement.

Whichever HTTP method you use, you'll be transmitting data in the clear unless you secure the connection using SSL.


I think the choice of PUT vs. POST should be more based on the rule:

PUT to a URL should be used to update or create the resource that can be located at that URL.

POST to a URL should be used to update or create a resource which is located at some other ("subordinate") URL, or is not locatable via http.

Any choices regarding security should work equally with both PUT and POST. https is a good start, if you are building a REST API then keys, authorisation, authentication and message signing are worth investigating.


Does HTTP PUT have advantages over HTTP POST, particularly for File Uploads?

You can use standard tools for sending the data (i.e. ones that don't have to be aware of your custom scheme for describing where the file should be uploaded to or how to represent that file). For example, OpenOffice.org includes WebDAV support.

Data transfer should be highly secure

The method you use has nothing to do with that. For security use SSL in combination with some form of authentication and authorization.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜