I am building a web server, I was wondering what status code should I use if the client wants to request this?
PUT /index.html HTTP/1.1
Host: localhost:1111
Lets say the client is trying to add a new file to the server, but that file already exist, what HTTP status code should the server respond with?
I read the definition for 406, on the e HTTP/1.1 RFC, but looks like it for something else.
Seems to me like this is the case for a 405 response "Method not allowed", because this method is not allowed for the requested url.
"for example, ... or using PUT on a read-only resource" http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error
Of course, that assumes you want to use the convention of using put only to insert new content and never to edit it.