I currently need to access an API that is set up in an staging environment on an Apache web server but the web server throws up a username/password dialog when browsing to the API url. Unfortunately I do not have access or control over the behavior of this web server.
Is it possible to programmatically send the username and password to an Apache web server?
You have ran into Basic Access Authentication. You just need to pass the username and password as part of the URL: