title: Best practices for REST API that access multiple environments
body: <p>When writing a RESTful API that needs to access different environments such as a lab/test database and a production database, what's the best practices around setting up the API?</p>
  
  <p>Should there be a <code>@PathParam</code>?:</p>
  
  <pre><code>/employee/{emp_id}/{environment}
  /{environment}/employee/{emp_id}/
  </code></pre>
  
  <p>Should there be a <code>@QueryParam</code>?:</p>
  
  <pre><code>/employee/{emp_id}/?environment="test"
  /employee/{emp_id}/?environment="prod"
  </code></pre>
  
  <p>Should there be a field in the payload?:</p>
  
  <pre><code>{"emp_id":"123","environment":"test"}
  {"emp_id":"123","environment":"production"}
  </code></pre>