title: Restful URLs with data in query string or request body?
body: <p>What's the rule of thumb for passing data in a REST URL in the query string vs. the body of a request?</p>
  
  <p>Ie: You're creating a service to add hockey players.  You could go with:</p>
  
  <pre><code>PUT /players 
  { "name": Gretzky }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>PUT /players?name=Gretzky
  </code></pre>
  
  <p>If you're passing a lot of data, you would need to go with option #1 as there is a limit on the URL length.  But other than this, why not just use the query string to pass data?</p>
  
  <hr>
  
  <p><strong>Update</strong>: Removed comment that you could test option #2 in a browser.  Realized (duh) that you can only do GET-s in your browser.</p>