Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP POST vs HTTP PUT

Tags:

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.

like image 324
Kingsley Reuben Avatar asked Jan 07 '10 19:01

Kingsley Reuben


2 Answers

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.

like image 193
Christopher Orr Avatar answered Sep 17 '22 16:09

Christopher Orr


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.

like image 23
Adam Griffiths Avatar answered Sep 18 '22 16:09

Adam Griffiths