title: Is it secure to send username and password in a Json object in the body of a post request?
body: <p>I am building a web application and my web server is secure, meaning that it uses an ssl cert with the front end to encrypt the connection.</p>
  
  <p>When a user logs in, a JSON object which looks like this is created, and sent to the server.</p>
  
  <pre><code>{
      username:"the user's username",
      password:"the user's password"
  }
  </code></pre>
  
  <p>On the server this is verified with a hashing algorithm that uses a salt. Once it is verified an api token is created which is valid for a certain amount of time, and is passed back and forth in the header in order to verify the user when requests are being made. Is sending the username and password like this best practice/secure, or is it better to send it in the header?</p>