title: Why not use PUT for REST queries that require a payload?
body: <p>REST recommends that <strong>queries</strong> (not resource creation) be done through the GET method.  In some cases, the query data is too large or structured in a way that makes it difficult to put in a URL, and to address this, a RESTful API is modified to support queries with bodies.</p>
  
  <p>It seems that the convention for RESTful queries that require bodies is to use POST.  Here are a few examples:</p>
  
  <ul>
  <li><a href="https://blogs.dropbox.com/developers/2015/03/limitations-of-the-get-method-in-http/" rel="nofollow noreferrer">Dropbox API</a></li>
  <li><a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html" rel="nofollow noreferrer">ElasticSearch</a></li>
  <li>O'Reilley's <a href="https://rads.stackoverflow.com/amzn/click/com/0596801688" rel="nofollow noreferrer" rel="nofollow noreferrer">Restful Web Services Cookbook</a> </li>
  </ul>
  
  <p>Queries don't modify the internal state of the system, but POST doesn't support idempotent operations.  However, PUT is idempotent.   Why don't  RESTful APIs use PUT with a body instead of POST for queries that require a body?</p>
  
  <p><strong>NOTE:</strong>  <a href="https://stackoverflow.com/questions/630453/put-vs-post-in-rest">A popular question</a> asks which (PUT vs POST) is preferred for creating a resource.  This question asks why PUT is not used for queries that require bodies.</p>