title: How to pass credentials to PHP api endpoint located on .htaccess protected apache web server
body: <p>I currently have an apache server running and an api endpoint in PHP </p>
  
  <p><code>https://myserver.com/api.php</code></p>
  
  <p>The server is utilizing .htaccess authentications (auth box pops up when first open URLs).</p>
  
  <p>I can make a post/get request to my endpoint successfully without any authentication, but I wonder if I enable the auth, how do I pass the credentials in a post or get request? </p>