title: Correct HTTP method for RESTful create-or-update?
body: <p>I'm creating a RESTful web service that allows me to import documents by name. I would import a document using a path like this:</p>
  
  <pre><code>/documents/frequently-asked-questions
  </code></pre>
  
  <p>If the document doesn't already exist, it would create a new one; otherwise, it would simply overwrite the existing document.</p>
  
  <p>The question I have is whether this is a wrongheaded endpoint for a RESTful service. Normally I'd use POSTs for creates and PUTs for updates. Here it's not known in advance whether the document already exists. If this is reasonable, then what's the best HTTP method? If it's not correct, then what's a better approach?</p>