I am creating a RESTful web service that allows me to import documents by name. I would import the document using the following path:
/documents/frequently-asked-questions
If the document does not exist yet, it will create a new one; otherwise, it will simply overwrite the existing document.
I have a question whether this is the wrong endpoint for a RESTful service. Usually I use POST to create and PUT to update. Here he does not know in advance whether this document exists. If this is reasonable, then what is the best HTTP method? If this is not correct, then what is the best approach?
design rest web-services
Willie wheeler
source share