title: Rest Api Best practice - Passing date as query param
body: <p>I am writing a rest service using NodeJs and express middleware. I have below questions -</p>
  
  <ol>
  <li><p>I have to take userid and token for authentication in every service irrespective of the method type i.e. <code>GET</code>, <code>POST</code>, <code>PUT</code> and <code>DELETE</code>. What is the best way to take these two param i.e  as request header or query param? I don't want to take it as body params since the get requests wouldn't have the body.</p></li>
  <li><p>I want to write a service with method type <code>GET</code> for data retrieval, the params for this call are string and a date. How shoule I pass the params as query parameter for this, specifically the date param should i pass it as js date or any other format?</p>
  
  <pre><code>GET - https://localhost:someport/&lt;objectid&gt;/&lt;createddate&gt;
  headers - x-user-id:someid
            x-access-token:sometoken
  </code></pre>
  
  <p>if this then which format the created date should be passed.</p>
  
  <p>or should I use the below one?</p>
  
  <pre><code>GET - https://localhost:someport/
  headers - x-user-id:someid
            x-access-token:sometoken
            x-object-id:someid
            x-created-date:somedate
  </code></pre></li>
  </ol>